Class: Rack::Session::Pool
- Inherits:
-
Abstract::ID
- Object
- Abstract::ID
- Rack::Session::Pool
- Defined in:
- lib/rack/session/pool.rb
Overview
Rack::Session::Pool provides simple cookie based session management. Session data is stored in a hash held by @pool. In the context of a multithreaded environment, sessions being committed to the pool is done in a merging manner.
Example:
myapp = MyRackApp.new
sessioned = Rack::Session::Pool.new(myapp,
:key => 'rack.session',
:domain => 'foo.com',
:path => '/',
:expire_after => 2592000
)
Rack::Handler::WEBrick.run sessioned
Constant Summary collapse
- DEFAULT_OPTIONS =
Abstract::ID::DEFAULT_OPTIONS.dup
Instance Attribute Summary collapse
-
#mutex ⇒ Object
readonly
Returns the value of attribute mutex.
-
#pool ⇒ Object
readonly
Returns the value of attribute pool.
Attributes inherited from Abstract::ID
Instance Method Summary collapse
-
#initialize(app, options = {}) ⇒ Pool
constructor
A new instance of Pool.
Methods inherited from Abstract::ID
Constructor Details
#initialize(app, options = {}) ⇒ Pool
Returns a new instance of Pool.
30 31 32 33 34 |
# File 'lib/rack/session/pool.rb', line 30 def initialize(app, ={}) super @pool = Hash.new @mutex = Mutex.new end |
Instance Attribute Details
#mutex ⇒ Object (readonly)
Returns the value of attribute mutex.
27 28 29 |
# File 'lib/rack/session/pool.rb', line 27 def mutex @mutex end |
#pool ⇒ Object (readonly)
Returns the value of attribute pool.
27 28 29 |
# File 'lib/rack/session/pool.rb', line 27 def pool @pool end |