Opening a new window creates a new session.

We are updating the web application from Windows XP using Internet Explorer 6 to Windows 7 using Internet Explorer 9.

In addition, the webbrowser object is used internally by the WPF application.

Now we have strange behavior when opening a window with a URL (with an instruction like window.open (url)), the ASP session is โ€œlostโ€, and the new window works with the new session from scratch.

I solved this problem by avoiding useless windows, and instead I change the location of the current window. But I would like to understand why this behavior!

Do you have any hints?

Thanks.

+4
source share
4 answers

This may be the reason for the simple other in your domain name, if you work on www.yoursite.com, but the window points to your .com site, then a new session will be created. Disgusting to catch, so stay tuned.

In addition, you may have some debugging code that will move on the page somewhere, this can lead to a big crash in the head, clearing the session variable for testing, for example. Something else to check for a long shot, although you never know.

+3
source

Assuming your navigation system goes to the same domain, another reason for this might be process switching. Starting with IE8, IE "chrome" and the contents of the tab have been split into two processes. IE can then create several content processes for content in different windows and tabs.

If your application hosts a web browser control that then launches a full IE window, it is likely that your new URL is being requested by a different process (iexpore.exe) rather than your application process. As a result, the request does not have access to the session files, so the session appears to be "lost."

(It is worth noting that instances of multiple instances of iexplore.exe in the same process tree have the ability to share session cookies with each other).

+2
source

I think you probably have the same problems as this answer . Essentially, this is probably due to security zone errors in IE on the specific computer that you are using. As others have noted, and I can repeat, the sessions are transferred to other IE windows (6, 7, 8, 9) opened by javascript if the domain does not change.

Good luck

+1
source

Some links to help you:

When you open a new window using javascript as IE by default, create a new window, itโ€™s also not the same session and history. If you get the latest referrer from a new javascript window, it will become empty in main browsers.

And you can save the session history if the window.open function runs inside the binding object:

<script> function windowOpen() { window.open("my_page.asp","_blank"); }; </script> <a href="javascript:windowOpen();">my link</a> 
0
source

Source: https://habr.com/ru/post/1385861/


All Articles