aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes How to track activesession Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "How to track activesession" Watch "How to track activesession" New topic
Author

How to track activesession

saxena Amit
Greenhorn

Joined: Jun 17, 2005
Posts: 5
When a user closes the window (you cannot know the session is killed),
his session is still active.
I want to invalidate his session prior to the session timeout.
Is there a way in SERVLET to invalidate the session of a user who closed the browser without logging out.
Pl help, its urgent.
srinath anand
Ranch Hand

Joined: Nov 20, 2001
Posts: 30
You can use the session.invalidate() method.


SCJP2,SCWCD 1.4
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

Is there a way in SERVLET to invalidate the session of a user who closed the browser without logging out.


There is no way to invalidate the session when the user close the browser window, because there is no way to know the container about this event (Closing window). But yo can programatically invalidate your session in servlet when you want using HttpSession.invalidate() method.

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Sushma Sharma
Ranch Hand

Joined: Jun 02, 2005
Posts: 139
The only way possible is to use java script to capture the window Close and call a java script function.... from there you can try invalidating the session....

what do you say, gurus???

Regards,

Sushma
 
 
subject: How to track activesession
 
Similar Threads
session invalidating using session ID????
Disabling a previous session in a web app
Ending a session?
time out
session invalidation of an active user