tags:

views:

87

answers:

3

Hi I know invalidating a session by setting a time-out period in DD-web.xml file but I like to know how to invalidate sessions programmatically?

A: 

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

Canoehead
DD-web.xml makes me think it's java, not asp.net though.
Michael Stum
You're probably right. I've edited to indicate ASP.NET. Thanks.
Canoehead
+3  A: 

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
vesparun
Ensure null-check if using getSession(false)!
Arne Burmeister
but how do you invalidate ALL sessions?
simpatico
Restart your web server? ;o) j/k, but that would be one way to do it
Jon
A: 

in Asp.net

Session.Abondon()

Lalit