wai-session-0.3.3: Flexible session middleware for WAI

Safe HaskellNone
LanguageHaskell98

Network.Wai.Session

Synopsis

Documentation

type Session m k v = (k -> m (Maybe v), k -> v -> m ()) Source #

Type representing a single session (a lookup, insert pair)

type SessionStore m k v = Maybe ByteString -> IO (Session m k v, IO ByteString) Source #

A SessionStore takes in the contents of the cookie (if there was one) and returns a (Session, IO action to get new contents for cookie) pair

withSession Source #

Arguments

:: SessionStore m k v

The SessionStore to use for sessions

-> ByteString

Name to use for the session cookie (MUST BE ASCII)

-> SetCookie

Settings for the cookie (path, expiry, etc)

-> Key (Session m k v)

Vault key to use when passing the session through

-> Middleware 

Fully parameterised middleware for cookie-based sessions

genSessionId :: IO ByteString Source #

Simple session ID generator using cryptographically strong random IDs

Useful for session stores that use session IDs.