Bug 54738

Summary: WebSocket messages does not set lastAccessTime to session, and after the session.maxIntervalTimeout() my session is deleted
Product: Tomcat 7 Reporter: Radu Toader <radu.m.toader>
Component: Servlet & JSP APIAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED INVALID    
Severity: major CC: radu.m.toader
Priority: P2    
Version: 7.0.37   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Radu Toader 2013-03-21 15:12:57 UTC
WebSocket messages does not set lastAccessTime to session, and after the session.maxIntervalTimeout() my session is deleted

I have attributes on httpsession, and I check them every time I want to send a message to browser-client through WebSocket.

    If the client is not making any other requests to page like AJAX or open another link, his sessions is deleted along with the attributes on the session.

   I have implemented ping-pong from client to server on WebSocket, I could reset the lastAccessTime of the session there, but the problem is that there is no visibility to session's lastAccessedTime so there is no way you can change it. The framework should do that for you.

I belive that a reset must be added whenever a message is received/send to/from client through WebSocket.
Comment 1 Mark Thomas 2013-03-21 15:18:35 UTC
This should be raised with the WebSocket EG. It is not an implementation issue (it might become one if the spec is changed).
Comment 2 Radu Toader 2013-03-21 15:23:12 UTC
At least there should be a way to setLastAccessed time to a session.
Comment 3 Nick Williams 2013-03-21 16:07:32 UTC
I have created an issue for this on the WebSocket API project JIRA [1]. You will need to login/register on java.net to view and/or watch it for updates. Registration is free.

[1] http://java.net/jira/browse/WEBSOCKET_SPEC-175