On 09/08/17 17:46, Christopher Schultz wrote:

> Websocket ignoramus, here. Is there a way for (websocket) application
> code on the server side to trigger a "touch" of the HttpSession that
> is linked with the connection? Or is the problem that the websocket
> connection and the HTTP connection are essentially independent?

Through standard APIs, no.

You can get a reference to the session object during the initial
handshake but you'd have to keep a reference to it and then cast it to
an internal Tomcat object and poke around via reflection to get Tomcat's
internal session object and call access().

If the Servlet EG could be convinced to add an access() method... (this
would have to wait until Servlet 4.next / Java EE 9)

We could provide an internal API that would make this a lot easier
(still requires casting but no reflection). That assumes it is always
safe to let an application update a session's last access time. I can't
think of a good reason not to allow this.


To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to