Home > JavaScript, Microsoft > IE8 – JavaScript window.open invalidates session?

IE8 – JavaScript window.open invalidates session?

March 14, 2008

Anyone else having this problem?  On web sites (my own included) that open a new window with the JavaScript window.open method, that new window no longer has access to session variables from the parent.

In IE7 and FF2, if I have a page that:

Session[”MyVar”] = “Hello, world”;
ClientScript.RegisterClientScriptBlock(
     this.GetType(),
     “PopupReport”,
     “<script language=’javascript’>window.open(‘RunReport.aspx’)</script>”);

Then, RunReport.aspx could read Session[”MyVar”] and output ‘Hello, world’.  That works fine.

Unfortunately, in IE8, the spawned window from window.open doesn’t have access to those session variables.  I ran across this again reading through some Microsoft Training materials—the new window couldn’t tell I was logged in—and there was nothing (that I could figure out) to fix it.

Going into IE7 mode doesn’t appear to fix it either, which is a bummer.

Ideas?

 

Categories: JavaScript, Microsoft
  1. Eslam Kamal
    April 9, 2008 at 2:29 am

    I face the same problem in a web application.
    I noticeed that this problem is not permanent.

  2. April 9, 2008 at 5:44 am

    @Eslam Kamal-

    Could you explain what you mean by “not permanent”?

  3. imak47
    January 3, 2009 at 2:18 am

    IE8 is still a beta, I havent bothered giving it a try as yet just bcz I’m already sort of sick with IE7. I really think MS should fix this issue coz its such a generic requirement. I suggest you should give them your feedback over this issue.

    Regards,


    Imran Akram

  4. Ian
    January 30, 2009 at 4:37 am

    This is still an issue with the release candidate (aka Beta 3). Other posts about it not being constant are correct. I have noticed that if I have no other browser windows open except my web app it seems to be ok. If other websites are open in other browser windows the sessions gets screwed. So far from a dev point of view I am hating IE 8😦

  5. Bobby
    March 21, 2009 at 4:11 pm

    I’m also noticing really odd session timeouts / invalidations on facebook with IE8

  6. Mahesh
    June 11, 2009 at 11:46 pm

    Hi
    I am facing the same issue,
    In my application, i need open the sub window, after work done with the sub window control should go back to parent window with same session, But in IE8 session expire and redirecting to login page.
    In ie7 and older version its working fine.
    if any one find solution please let know.

  1. No trackbacks yet.
Comments are closed.
%d bloggers like this: