Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to detect the termination of a HttpSession?

Status
Not open for further replies.

thebigf

Programmer
Dec 12, 2000
14
AT
I'm currently writing a Helpdesk/Webpagemirroring system.

Every customer gets a HttpSession. Also every Helpdesk-assistent gets an unique session. Because the mirrorconcept in our project needs to combine both IDs (to identify which events from which customer must be send to which helpdesk) the main servlet (who creates the HttpSessions) stores all data in a hasttable, where the hashtableID is the ID of the HttpSession.

My problem is: How can I find out when a customer leaves the page and his session gets destroyed because of timeout (there could be customers that do not log off correctly)? I need this logoff info because I have to cleanup my hashtable (or we will get memory problems with the servlet engine if we never delete those customerspecific data).

I have already thought of writing lastaccesstimes into my hashtable and checking them every time the servlet is called (and delete entries if they are too old). But that is bad for our performance and rather complicated.

Better ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top