在 asp.net 的另一个选项卡中打开 url 时如何更改会话
我正在 asp.net 中开发一个 Web 应用程序。我正在弹出窗口中打开所有页面。当有人复制 url 并将其粘贴到另一个选项卡中时,我想使会话过期或更改会话值。我怎样才能实现它? 请帮帮我。
I am developing one web application in asp.net. I am opening my all pages on pop up window. I want to expire my session or change the session value when someone copy the url and paste it into another tab. How can i implement it ?
Please help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种简单的方法是检查 Request.UrlReferrer。如果用户复制粘贴 URL,Referrer 将为空。
在使用此功能之前,您应该考虑以下几点:
用户。对于例如登录页面或可以添加书签的页面,
有关确定用户是否打开新选项卡的通用方法,请参阅此处
A simple way would be to check Request.UrlReferrer. The Referrer would be empty if the user copy pastes a URL.
A couple of points you should consider before using this:
the user. For e.g. the login page or a page that can be bookmarked
For a generic way to determine if the user has opened a new tab, see here
我已经用这个解决了这个问题
I have solved this problem by using this