PhoenixRedisSession
The Redis Session adapter for the Phoenix.
Based on Thoughtbot/Redbird, change to use Redix.
Installation
The package can be installed by adding :phoenix_redis_session to your list of dependencies in mix.exs:
def deps do
[
{:phoenix_redis_session, "~> 0.1.2"}
]
endConfiguration
Redix
config :redix, :redis,
host: "localhost",
port: 6379,
database: 0,
name: :sessionSession key_namespace
All redbird created keys are automatically namespaced with "session_" by default. If you'd like to set your own custom, per app, configuration you can set that in the config.
config :phoenix_redis_session, :key_namespace, "redis_session_"Plug
plug Plug.Session,
store: :redis,
key: "_app_key",
expiration_in_seconds: 3000 # Optional - default is 30 daysEnvironment:
Latest environment is as below.
- Arch Linux version 5.19.11-arch1-1
- Erlang 25.0
- Elixir 1.14.1
Programing environment is as below.
- Ubuntu 18.04.1 LTS
- Erlang 21.2
- Elixir 1.8.1
References:
Licence:
[MIT]