Class: ActionDispatch::Session::RedisSessionStore
- Inherits:
-
AbstractStore
- Object
- AbstractStore
- ActionDispatch::Session::RedisSessionStore
- Defined in:
- lib/redis_session_store.rb
Overview
:expire_after => A number in seconds to set the timeout interval for the session. Will map directly to expiry in Redis
Instance Method Summary collapse
-
#initialize(app, options = {}) ⇒ RedisSessionStore
constructor
A new instance of RedisSessionStore.
Constructor Details
#initialize(app, options = {}) ⇒ RedisSessionStore
Returns a new instance of RedisSessionStore.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/redis_session_store.rb', line 15 def initialize(app, = {}) # Support old :expires option [:expire_after] ||= [:expires] [:key_prefix] ||= [:key] super @default_options = { :namespace => 'rack:session', :host => 'localhost', :port => '6379', :db => 0, :key_prefix => "" }.update() @pool = Redis.new(@default_options) end |