The SessionManager associates an object with a Session ID
to give Handlers the ability to maintain state that lasts for the
duration of a session instead of just for the duration of a request.
Package sunlabs.brazil.session Description
A generic, extensible mechanism for managing session state.
The
SessionManager
associates an object with a Session ID
to give Handlers the ability to maintain state that lasts for the
duration of a session instead of just for the duration of a request.
An example of session-lifetime information is the set of stocks that
a particular user is interested in. When the hypothetical
StockHandler gets a request, it would get determine which
stocks to display based on the Session ID of the request.
Operating with the
SessionManager
is the mechanism to
discover the Session ID of a request and/or create new Session IDs.
For example, the first time a user goes to the server providing the stock
market information, they could get a cookie. Subsequently, every time
they visit the stock market page the cookie present in the request
would be decoded and matched with the existing Session ID for use by
the StockHandler.
The
SessionManager
operates as a bag of globally
accessible resources. Existing subclasses of the
SessionManager
also provide persistence, that is, a way to
recover these resources even if the server process is terminated and
later restarted, to get back to the state things were in.