且构网

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

用户注销时如何清除会话?

更新时间:2023-12-04 19:17:40





在这里查看:

http://forums.asp.net/t /1366105.aspx/1 [ ^ ]

http: //***.com/questions/345157/asp-net-how-to-clear-out-session-on-log-out [ ^ ]

注销后清除会话 [ ^ ]

http://***.com/questions/347377/in-asp-net-when-should-i-use-session-clear - 而不是会话放弃 [ ^ ]
Hi,

Have a look here:
http://forums.asp.net/t/1366105.aspx/1[^]
http://***.com/questions/345157/asp-net-how-to-clear-out-session-on-log-out[^]
Clearing session after logout[^]
http://***.com/questions/347377/in-asp-net-when-should-i-use-session-clear-rather-than-session-abandon[^]


尝试使用它。

try to use this.
session.clear();
session.abandon();


为了清除会话值,您可以使用以下



For clearing the session values, you can use the following

session.clear();
session.abandon();





和页面加载检查

的值



and on page load check the value of the

if(session["uid"]==null)
{
//redirect page
}





谢谢



Thanks