Each request made to a Web server is inspected to determine from where the session information is retrieved (in-memory or database). After processing, session information is updated and saved to a database. Web application filters and the SessionManager interface are used to intercept and process requests before the response is sent back to the client. The filters determine if:
A new session is created – if there was none before invoking the servlet/JSP but there is one afterwards.
The existing session is modified – If there was a session before the servlet/JSP and there is one afterwards, then a comparison is made to see if any attributes change. If so, the database and version cookie are updated.
The session is removed – when there was a session before the servlet/JSP but none afterwards the session is deleted from the database.