我们如何登出 [英] How we Logout

查看:111
本文介绍了我们如何登出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net 3.5

我开发了一个网络应用程序.对于注销,我使用session.abondon()方法

但是当注销后单击浏览器的后退选项时,我可以进入管理页面.我不想在注销后转到此页面.

请帮助我............

i am using asp.net 3.5

i develop a web applicaton. for logout i use session.abondon() method

but when a click on back option of browser after logout i can go on admin page. i don''t want to go this page after logout.

plese help me............

推荐答案

请参见以下链接


注销后处理浏览器后退按钮
See below link


Handling browser back button after logout


后退按钮将始终将您重定向到先前访问的页面,但是一旦会话被放弃,从该页面进行的进一步前向重定向将受到限制.

或者,您可以使用JavaScript删除以前的历史记录,以使其不再返回并被禁用.
The back button will always redirect you to previously visited page, But further forward redirection from that page will be restricted once session is abandoned.

Alternatively you can use JavaScript to remove previous history so that it will not go back and it will be disabled.


我在注销时也有类似的经历,但实际上并没有.问题不在于尚未正确设置的会话变量,而在于程序逻辑错误.编写这样的程序非常容易:

如果session("seeUserLoginOK")<>然后确定"
错误消息...
如果
结束
....所有其他codse都包含html display

在每个程序中都必须执行的正确方法是:

如果session("seeUserLoginOk")<>然后确定"
错误消息....
其他

....所有其他代码都包括html display

如果
结束
这是一个简单的错误,有经验的传统C程序员很容易陷入.同样也可以阻止不必要的访问.

rgds,
kfl.
I have similar experience on the logout and yet not really out. The issue is not on session variable that has not set correctly but on the program logic error. It is very easy to write program like:

if session("seeUserLoginOK") <> "OK" then
error messaging...
end if

.... all other codse include html display

The correct way, and have to be do it in every program, is:

if session("seeUserLoginOk") <> "OK" then
error messaging....
else

.... all other codes include html display

end if

This is a simple error experienced traditional C programmer can easily fell into. It is also impoprtant in stop unwanted access as well.

rgds,
kfl.


这篇关于我们如何登出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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