Abstract::ID
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.
The :drop option is available in rack.session.options if you wish to explicitly remove the session from the session cache.
Example:
myapp = MyRackApp.new sessioned = Rack::Session::Pool.new(myapp, :domain => 'foo.com', :expire_after => 2592000 ) Rack::Handler::WEBrick.run sessioned
# File lib/rack/session/pool.rb, line 61 61: def destroy_session(env, session_id, options) 62: with_lock(env) do 63: @pool.delete(session_id) 64: generate_sid unless options[:drop] 65: end 66: end
# File lib/rack/session/pool.rb, line 37 37: def generate_sid 38: loop do 39: sid = super 40: break sid unless @pool.key? sid 41: end 42: end
# File lib/rack/session/pool.rb, line 44 44: def get_session(env, sid) 45: with_lock(env, [nil, {}]) do 46: unless sid and session = @pool[sid] 47: sid, session = generate_sid, {} 48: @pool.store sid, session 49: end 50: [sid, session] 51: end 52: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.