且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

注销后禁用返回选项

更新时间:2023-12-02 15:01:04

在您不希望用户单击后退"以注销的页面上,请确保以下内容

1)您的页面受到正确的保护,需要凭据才能查看它们

2)您的页面具有NoCache指令

On your pages where you don''t want the user to be able to click ''back'' to once logged out, make sure the following

1) Your pages are correctly protected and require credentials in order to view them

2) Your pages have a NoCache directive

Response.Cache.SetCacheability(HttpCacheability.NoCache);



如果您执行上述两项操作,则如果用户在注销后尝试单击回去,则必须重新加载页面,这将迫使他们返回登录页面



If you do these 2 things, if a user tries to click back once they are logged out the page will have to reload, which will force them back to the login page


您可以执行此操作使用JavaScript.但是也有一些问题.
阅读此主题!
http://forums.asp.net/t/989339.aspx [
You can do it using JavaScript. But there are some problem also.
Read this thread !
http://forums.asp.net/t/989339.aspx[^]