wai-session-alt-0.0.0: An alternative session middleware for WAI.

Copyright(c) 2015 Athan Clark
LicenseBSD-3
Maintainerathan.clark@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Network.Wai.Session

Description

A simple interface for storing and parsing session information into cookies, which slightly differs from the wai-session interface designed by Greg Weber.

Documentation

data SessionConfig m k v Source

Constructors

SessionConfig 

Fields

renderKey :: k -> ByteString

serialize the key

renderVal :: v -> ByteString

serialize the value

parseKey :: ByteString -> Maybe k

parse the serialized key

parseVal :: ByteString -> Maybe v

parse the serialized value

keyName :: ByteString

name used as a cookie

valName :: ByteString

name used as a cooke

expire :: Integer

expiration time in Seconds

newVal :: k -> v -> m (Maybe v)

method to getting another value - this could ping a nonce cache in m for instance.

vaultVar :: Key k

The vault Key used to store the session key when newVal is successful.

sessionMiddleware :: Monad m => SessionConfig m k v -> MiddlewareT m Source

parseSessionCookies :: SessionConfig m k v -> RequestHeaders -> Maybe (k, v) Source

renderSessionCookies :: SessionConfig m k v -> k -> v -> ResponseHeaders Source