0

I am trying to open a new window from code behind when the user clicks on a link button, but my application cookies and session is killed as user cannot do anything on the request page but i can see the window correctly with the response URL. Why is this happening and during the response I am not doing anything with the cookies. I was using the following post Response.Redirect to new window

        string url = "XYZ"
        string target = "";
        string windowFeatures = "menubar=0,scrollbars=1,width=780,height=900,top=10";
        script = @"window.open(""{0}"", ""{1}"", ""{2}"");";
        script = String.Format(script, url, target, windowFeatures);
        ScriptManager.RegisterStartupScript(page, typeof(Page), "Redirect", script, true);
Community
  • 1
  • 1
decoder
  • 15
  • 5

1 Answers1

0

Your session is actually stored in an asp.net cookie, so that makes me think your cookies aren't valid in the new window.

For some reason, is your URL different? Cookies aren't shared across domains, so if your main app is at "123.com" and your new window is at "XYZ.com", they won't have access to each other's cookies. That means no session, etc.

If you're not on different domains, then there is something else happening (specific code) that's wiping out your cookies. For example, if for some reason, your new window is opening in a different browser (which would take some interesting code) or if your browser is wiping cookies.

If you need more help, post more of the code so we can get more context.

NinjaMid76
  • 169
  • 8
  • I am not sharing cookies I am just trying to show a new window with "xyz.com" url and user will be on our application only but the problem is when i am showing the new window my app session is killed. – decoder Sep 24 '14 at 15:34