注销后如何阻止用户转到网页 [英] how to stop user togo to the webpage after logout
本文介绍了注销后如何阻止用户转到网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网站
我在其中放置了注销按钮的位置,然后在注销按钮上单击我编写代码
Session.Abendon();
但是在单击注销按钮后,如果用户单击浏览器的后退按钮,则用户会到达previos页面.
我希望该用户如果没有登录就无法访问任何页面
I have a website
where i have put a logout button and on the logout button click i write code
Session.Abendon();
but after clicking on logout button if user click on browsers back button then user reach to previos page.
i want that user can not visit any page without login
推荐答案
请参阅此链接
注销后浏览器后退按钮问题 [
Please see this link
Browser back button issue after logout[^]
这是由于缓存问题.
为您的网页创建一个基础页面,并设置加载事件的可缓存性,
This is because of the caching issue.
Create a base page for your web pages and set the cacheability on load event,
Response.Cache.SetCacheability(HttpCacheability.NoCache);
我假设您已经为页面设置了会话验证逻辑(重定向到登录页面).如果没有,请在同一基础页面中添加该逻辑.
I assume you have the session validation logic in place for your pages(redirect to login page). If not, add that logic in the same base page.
这篇关于注销后如何阻止用户转到网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文