Use PostgreSQL (ecto...) as session store.
If available in Hex, the package can be installed
by adding plug_session_pg
to your list of dependencies in mix.exs
:
def deps do
[
{:plug_session_pg, "~> 0.1.0"}
]
end
Add to your configuration:
config :plug_session_pg,
repo: [YOUR_MODULE].Repo,
max_age: 3600
Update the plug session configuration:
plug Plug.Session,
store: PlugSessionPg.Store,
...
You can then create the sessions table in your database using the task :
$ mix PlugSessionPg.install [YOUR_MODULE]
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/plug_session_pg.