The session-package provides some interfaces to implement session trackers. The core interfaces are SessionContext, which represents a user session among several requests and SessionTracker, which defines the methods common to all classes that provide session tracking facilities.

In addition to these interfaces the package does include implementations for session trackers based on

The cookie-based session tracker is probably the best starting point to implement your own session tracker by either directly extending the cookie-session tracker or using the AbstractSessionTracker as a basis.