I have a problem with all multpile tab browsers due to session object. I have a requirement that whenever user opens a new browser I need to show different values, so I thought of using Session as in IE 6 every browser creates a new session. But all other multiple tab broswers IE 7 and IE 8 and FF shares the session(If user has already open the browser and try to open different broswer). Can somebody tell me how can I create new session whenver user opens a new browser window. My application is basically in ASP.NET and server side we have VB.NET.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This is because you are using cookie-based sessions. Your web page instructs the browser to store a tiny file with data locally and this data is sent back to the web server whenever your browser requests a page. This cookie file is shared between all tabs in your browser instance.
Normally this is what the user expects so you should have a really good reason if you want to change it, but if need to the solution is to use the query string to store the session identifier. This is configured in your web.config file by setting the cookieless
attribute of the sessionState
element to the value UseUri
. See here for the documentation on the sessionState element.