0

In Tomcat's documentation, the definition of system property org.apache.catalina.session. StandardSession.ACTIVITY_CHECK states the following:

If this is true, Tomcat will track the number of active requests for each session. When determining if a session is valid, any session with at least one active request will always be considered valid.

I find no definition of an "active request" in the docs. Does that mean "not idle" in the sense that the request is not older than minIdleSwap?

Also, in the quote above "valid session" seems to mean "active session". Are these two terms synonymous for Tomcat? I would think that "valid" means that the session has neither expired nor been explicitly invalidated. That is not related to activity.

May I please get some guidance on the terminology (active request, active session, valid session)?

ARX
  • 135
  • 1
  • 1
  • 6

1 Answers1

0

"active request" means a request that Tomcat is currently processing.

"valid session" means a session that has not expired.

"active session" (if used) means the same as "valid session".

The Servlet spec defines the last accessed time of a session as the last time a request was received that was associated with the session. If you have very long running requests and short session timeouts you could have the situation where a session times out while a request associated with it is still being processed. This isn't as unreasonable as it sounds. Consider large file downloads / uploads over slow links.

StandardSession.ACTIVITY_CHECK was added to avoid this edge case.

If StandardSession.ACTIVITY_CHECK is set, Tomcat will never expire a session if there is at least one request being processed that is associated with the session.

Mark Thomas
  • 887
  • 5
  • 8
  • Truly an edge case that explains it. Could have not figured this out on my own. I'd suggest adding this to the docs. – ARX Jan 18 '18 at 14:37