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()
精彩评论