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?
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?