Plug.Session

Plug.Session

A plug to handle session cookies and session stores.

The session is accessed via functions on Plug.Conn. Cookies and session have to be fetched with Plug.Conn.fetch_session/1 before the session can be accessed.

Consider using Plug.CSRFProtection when using Plug.Session.

Session stores

See Plug.Session.Store for the specification session stores are required to implement.

Plug ships with the following session stores:

Options

Additional options can be given to the session store, see the store’s documentation for the options it accepts.

Examples

plug Plug.Session, store: :ets, key: "_my_app_session", table: :session

Summary

Functions

call(conn, config)

Callback implementation for Plug.call/2

init(opts)

Callback implementation for Plug.init/1

Functions

call(conn, config)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.

© 2013 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/plug/Plug.Session.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部