Plug.Session.Store
Plug.Session.Store behaviour
Specification for session stores.
Summary
Types
Callbacks
- delete(arg0, sid, arg2)
-
Removes the session associated with given session id from the store
- get(arg0, cookie, arg2)
-
Parses the given cookie
- init(arg0)
-
Initializes the store
- put(arg0, sid, any, arg3)
-
Stores the session associated with given session id
Types
cookie()
cookie() :: binary
session()
session() :: map
sid()
sid() :: term | nil
Callbacks
delete(arg0, sid, arg2)
delete(Plug.Conn.t, sid, Plug.opts) :: :ok
Removes the session associated with given session id from the store.
get(arg0, cookie, arg2)
get(Plug.Conn.t, cookie, Plug.opts) :: {sid, session}
Parses the given cookie.
Returns a session id and the session contents. The session id is any value that can be used to identify the session by the store.
The session id may be nil in case the cookie does not identify any value in the store. The session contents must be a map.
init(arg0)
init(Plug.opts) :: Plug.opts
Initializes the store.
The options returned from this function will be given to get/3
, put/4
and delete/3
.
put(arg0, sid, any, arg3)
put(Plug.Conn.t, sid, any, Plug.opts) :: cookie
Stores the session associated with given session id.
If nil
is given as id, a new session id should be generated and returned.
© 2013 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/plug/Plug.Session.Store.html