It can sometimes be useful to be able to preserve existing Sessions across restarts of Jetty. The org.mortbay.jetty.servlet.HashSessionManager now supports this feature. If persistence is enabled, the HashSessionManager will save all existing, valid Sessions to disk before shutdown completes. On restart, the saved Sessions are restored.
A SessionManager does just what it's name suggests - it manages the lifecycle and state of Sessions on behalf of a webapp. Each webapp must have it's 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 sessions:
Enabling Persistence for the Maven Jetty Plugin
To enable session persistence for the maven jetty plugin, set up the HashSessionManager in the <configuration> section like so: