我如何防止注销会话下的返回按钮 [英] how can i prevent back button under log out session

查看:68
本文介绍了我如何防止注销会话下的返回按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi ..
请告诉我有关注销的信息...例如,当我们注销时以电子邮件的gmail形式发送.在
之后 注销..如果我们单击后退按钮...页面重定向到登录页面...
请实施..


谢谢

hi..
please tell me about log out ...for example in gmail of email when we sign out . after
sign out ..if we prss back button ...page redirect to login page...
Please give an implementation..


Thank you

推荐答案

通常,注销过程会终止客户端和服务器端的会话,并且/或者清除会话的身份验证状态.如果要访问任何受保护的页面,则会重定向到登录页面.如果您对如何在ASP.NET中实现此方法感兴趣,只需使用Visual Studio中包含的经过表单身份验证的模板创建项目.
在这里,您有一个概述: http://msdn.microsoft.com/en-us/library/ff647070. aspx [^ ]

另一个考虑因素:后退按钮也与缓存有关.有了上述内容,后退"将显示缓存的页面.您需要禁用客户端缓存 [ ^ ],以确保可以从服务器重新加载页面,并且您可以重定向到登录页面.
In general the logoff process kills the session on client and server side, and/or clears the authenticated status of the session. If you want to access any protected page, you get a redirection to the logon page. If you are interested in how you can achieve this in ASP.NET, just create a project using the forms authenticated template included in Visual Studio.
Here you have an overview: http://msdn.microsoft.com/en-us/library/ff647070.aspx[^]

An other consideration: back button has also to do with caching. With just the above things "back" will show the cached page. You need to disable client side caching[^] to ensure page reload from server and you can redirect to logon page.


简单的答案是,不必依赖浏览器的后退按钮,在服务器端组件中实施逻辑以检查用户是否已通过身份验证,如果未通过验证,则重定向到登录"页面.
In simple way the answer is, don''t be depend on the browser''s back button, Implement logic in your server side component to check the user is authenticated or not , if not then redirect to Login page.


以下提示应有助于:
Following tip should help: Browser back button issue after logout[^]


这篇关于我如何防止注销会话下的返回按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆