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

Safe HaskellSafe-Infered

Snap.Snaplet.TypedSession.Client

Description

This is the client-side cookie-backed implementation of typed sessions. Because all data is stored on the client, this session back-end is easier to use in load balanced settings, and session timeouts are optional. All session data is encrypted so that it cannot be read by the client itself. However, it has the disadvantage of only being able to store serializable data types.

Synopsis

Documentation

data ClientSessionManager t Source

The typed session manager that stores session data directly in encrypted client-side cookies.

initClientSessionsSource

Arguments

:: Serialize t 
=> FilePath

Location of an encryption key

-> ByteString

Name for the session cookie

-> Maybe Int

Optional session timeout in seconds

-> IO t

Initializer for new sessions

-> SnapletInit b (ClientSessionManager t) 

Initializer for the cookie-backed typed session snaplet.