在 IE7 中使用新选项卡时的会话是唯一的
我在 web.config 文件中提供 sessionstate,如下所示
sessionstate mode="InProc" cookieless="UseUri
这样每个选项卡都会在 URL 中生成一个新的唯一会话 ID,格式如下: http://www.domain.com/(S(kbusd155dhzflbur53vafs45))/default .aspx
它有效,但是当我复制 url 并将其粘贴到另一个选项卡上时,就会继承以前的会话值。我该如何解决这个问题?还有其他方法可以解决问题吗?
I provide sessionstate in my web.config file like this
sessionstate mode="InProc" cookieless="UseUri
That way each tab generates a new unique session ID in the URL with the format like this :
http://www.domain.com/(S(kbusd155dhzflbur53vafs45))/default.aspx
It worked, but when I copy the url and paste it on another tab then the previous session value is inheriting. How can I solve this issue? Is there anyother method to solve issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这种情况的一个可能的解决方案是在您写给客户端的每个响应中发出一张票证(guid 或类似的东西)。在请求中,客户端将发送此票证,服务器将 1) 检查它是否有效,2) 使其无效,以便只能使用它发出一个请求(原始请求)。这样您的用户将无法利用新选项卡,甚至无法复制/粘贴 URL。
A possible solution to this situation would be issue a ticket (guid or seomthing like that) in each response you write to the client. In the request the client would send this ticket and the server would 1) Check to see if it is valid and 2) Invalidate it so just one request (the original one) could be made with it. This way your user wouldn't be able to take advantage of new tabs or even copy/paste of URLs.
如果用户将包含现有会话令牌的 URL 粘贴到新选项卡中,您的应用程序不可能知道这是新选项卡而不是现有选项卡。恐怕如果没有一些黑客浏览器插件,你对此无能为力。
If the user pastes a URL containing an existing session token into a new tab, your application cannot possibly know that this is a new tab and not an existing tab. I'm afraid that short of some hacky browser plugin there isn't much you can do about this.