View Source Antikythera.Plug.Session (antikythera v0.5.1)
Plug to automatically load/store session information using a specific session store. Uses cookie store by default.
Usage
Adding the following line in a controller module enables this plug:
plug Antikythera.Plug.Session, :load, [key: "12345678"]
Then,
- session values are loaded from cookie before controller action is executed, and
- session values are stored into cookie after controller action is executed.
Summary
Types
@type load_option_t() :: {:key, String.t()} | {:store, atom()} | {:set_cookie, Antikythera.Http.SetCookie.options_t()}
Functions
@spec load(Antikythera.Conn.t(), [load_option_t()]) :: Antikythera.Conn.t()