private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
It is sometimes useful to preserve existing Sessions across restarts
of Jetty. The
HashSessionManager supports this feature. If you enable
HashSessionManager saves all existing, valid
Sessions to disk before shutdown completes. On restart, Jetty restores the
A SessionManager does just what its name suggests–it manages the
lifecycle and state of sessions on behalf of a webapp. Each webapp must
have its own unique SessionManager instance. Enabling persistence is as
simple as configuring the
HashSessionManager as the
SessionManager for a webapp and telling it where on disk to store the
If you want to persist the sessions from multiple webapps:
Configure a separate HashSessionManager for each.
Assign to each a different value for 'storeDirectory'.
You might need to ensure that the sessions are loaded AFTER the servlet environment starts up (by default, Jetty eagerly loads sessions as part of the container startup, but before it initializes the servlet environment). For example, the Wicket web framework requires the servlet environment to be available when sessions are activated.
SessionManager.setLazyLoad(true), Jetty loads
sessions lazily either when it receives the first request for a session,
or the session scavenger runs for the first time, whichever happens first.
Here's how the configuration looks in XML: