Skip to content

Latest commit

 

History

History
37 lines (32 loc) · 813 Bytes

README.md

File metadata and controls

37 lines (32 loc) · 813 Bytes

PlugSessionRedis

hex.pm version

The Redis Plug.Session adapter for the Phoenix framework. Poolboy + Redis.

Usage

# mix.exs
def application do
  [applications: [..., :plug_session_redis]]
end

defp deps do
  [{:plug_session_redis, "~> 0.1" }]
end

config.exs

config :plug_session_redis, :config,
  name: :redis_sessions,
  pool: [size: 2, max_overflow: 5],
  redis: [host: '127.0.0.1', port: 6379]

endpoint.ex

plug Plug.Session,
  store: PlugSessionRedis.Store,
  key: "_my_app_key",       #
  table: :redis_sessions,   #  
  signing_salt: "123456",   #
  encryption_salt: "654321",#
  ttl: 360                  # use redis EXPIRE secs