Opening a new window create a new session

不问归期 提交于 2019-12-05 15:28:45

This could be cause by a simple different in your domain name, if you are running on www.yoursite.com but the window points to yoursite.com then a new session will be created. A nasty one to catch so look out for it.

Additionally you might have some debug code floating around in a page somewhere, this can cause a lot of head scratching, clearing out a session variable for testing for instance. Something else to check for, long shot though but you never know.

Assuming your navigation all go to the same domain then another cause for this could be the switching of processes. As of IE8 the IE "chrome" and tab content were seperated into two processes. Further IE can create multiple content processes for content in different windows and tabs.

If your app is hosting a webbrowser control which then launches a full IE window, the chances are that your new URL is being requested by another process (iexpore.exe) not your apps process. As a result the request does not have access to session cookies hence the session appears "lost".

(Its worth noting that the multiple iexplore.exe process instances in the same process tree have a means of sharing session cookies with each other).

neouser99

I think you are likely having the same problems that this answer addresses. Essentially it is probably due to Security Zone errors within IE on the specific computer you are using. As others have noted and I can reiterate, sessions are carried into other IE (6, 7, 8, 9) windows opened by javascript, as long as the domain is not changing.

Good luck!

Some references to help you:

When you open a new window using the javascript as default IE, create a new window, as well isn't the same session and history. If you get the last referrer from a javascript new window, it will come empty in major browsers.

And you can keep your session history if your window.open function is triggered inside an anchor object:

<script>
function windowOpen() { window.open("my_page.asp","_blank"); };
</script>
<a href="javascript:windowOpen();">my link</a>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!