开发者

how to invalidate sessions programmatically?

I know invalidating a session by setting a time-out per开发者_JAVA百科iod in DD-web.xml file but I like to know how to invalidate sessions programmatically?


Not sure if you programm in java, but the hint of the deplyment descriptor web.xml looks like java. In that case try the following steps:

HttpSession session = request.getSession(false); // fetch a reference to the existing session
...
session.invalidate(); // invalidates this session and unbinds any objects bound to it


If in ASP.NET, I think you are looking for HttpSessionState.Abandon().


in Asp.net

Session.Abondon()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜