Plug.Session.Store behaviour

Specification for session stores.

Source

Types

sid :: term | nil

cookie :: binary

session :: map

Callbacks

delete/3

Specs:

Removes the session associated with given session id from the store.

Source
get/3

Specs:

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.

Source
init/1

Specs:

Initializes the store.

The options returned from this function will be given to get/3, put/4 and delete/3.

Source
put/4

Specs:

Stores the session associated with given session id.

If nil is given as id, a new session id should be generated and returned.

Source