如何消灭在同一时间在asp.net中所有会话? [英] how to Destroy all sessions at one Time in asp.net?

查看:70
本文介绍了如何消灭在同一时间在asp.net中所有会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在同一时间销毁所有的会话。我曾尝试 Session.Abondon()方法,但我不知道这是为什么不销毁所有的会话。

I want destroy all sessions at one time. I have tried Session.Abondon() method but I don't know why this is not destroying all the sessions.

推荐答案

您不能摧毁所有的会话,只能清除当前会话。您的可能的有回收应用程序池,以清除所有会话。

You can't destroy all the sessions, you can only clear current session. You probably have to recycle the application pool to clear out all sessions.

使用 HttpSessionState.Clear 来清除当前会话

<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.clear%28v=vs.100%29.aspx\"相对=nofollow>从MSDN - HttpSessionState.Clear方法

移除会话状态集合中的所有键和值。

Removes all keys and values from the session-state collection.

调用它:

Session.Clear();

这篇关于如何消灭在同一时间在asp.net中所有会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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