IE 7,IE 8等多标签浏览器会话问题浏览器、标签、问题、IE

2023-09-03 08:13:25 作者:错过一步 就是一生

我有,由于会话对象的所有multpile选项卡浏览器中的一个问题。我有一个要求,只要用户打开一个新的浏览器,我需要显示不同的值,所以我想用会话在IE 6中每一个浏览器创建一个新的会话。但是,所有其他的多标签broswers IE 7和IE 8和FF共享会话(如果用户已经打开浏览器并尝试打开不同broswer)。谁能告诉我怎样才能创建新的会话whenver用户打开一个新的浏览器窗口。我的应用程序基本上是在ASP.NET和服务器端,我们有VB.NET。

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.

推荐答案

这是因为您使用的是基于cookie的会话。您的网页指示浏览器在本地存储一个微小的文件的数据和该数据被发送回每当你的浏览器请求网页的web服务器。这个cookie文件在您的浏览器实例中的所有选项卡之间共享。

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.

通常这是用户期望,所以你应该有一个很好的理由,如果你想改变它,但如果需要的解决方案是使用查询字符串来存储会话标识符。这是由的sessionState 元素的无Cookie 属性的值设置为 UseUri 。 看到这里的sessionState元素中的文档。

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.