snaplet-typed-sessions-0.5: Typed session snaplets and continuation-based programming for the Snap web framework

Safe HaskellSafe-Infered



This is the server-side memory-backed implementation of typed sessions. It has the advantage of being able to store arbitrary data structures including functions and other non-serializable data. As a result, though, it is limited to a single server-side process since it's not possible to migrate arbitrary data between nodes. Load balancing with this snaplet requires sticky sessions or a similar technique to ensure that a given client always reaches the same server-side node.



data MemorySessionManager t Source

A typed session manager that stores session data by session key in a server-side map.



:: FilePath

Location of an encryption key

-> ByteString

Name for the session ID cookie

-> Int

Session timeout in seconds

-> IO t

Initializer for new sessions

-> SnapletInit b (MemorySessionManager t) 

Initializer for the memory-backed typed session snaplet.