Module
Biscotti.Session
- Package
- purescript-biscotti-session
- Repository
- drewolson/purescript-biscotti-session
Session
provides 4 basic functions: create
, get
, set
and destroy
.
create
takes aSessionStore
and your session data and returns a Cookie representing your new session.get
takes aSessionStore
and aCookie
and returns your session data, if available.set
takes aSessionStore
, your session data and your current sessionCookie
. It returns a new sessionCookie
.destroy
takes aSessionStore
and your sessionCookie
and returns a new, empty sessionCookie
.
#cookieStore Source
cookieStore :: forall a. DecodeJson a => EncodeJson a => String -> String -> SessionStore a
#memoryStore Source
memoryStore :: forall a. DecodeJson a => EncodeJson a => String -> Effect (SessionStore a)
Re-exports from Biscotti.Session.Store
#SessionStore Source
newtype SessionStore a
#set Source
set :: forall a. EncodeJson a => SessionStore a -> Setter a
Update a cookie to represent a new session
#get Source
get :: forall a. DecodeJson a => SessionStore a -> Getter a
Retrieve the session represented by a cookie
#destroy Source
destroy :: forall a. EncodeJson a => SessionStore a -> Destroyer
Destroy the session represented by a cookie and expire the cookie
#create Source
create :: forall a. EncodeJson a => SessionStore a -> Creater a
Create a cookie representing a new session