Class | Rack::Session::Cookie |
In: |
lib/rack/session/cookie.rb
|
Parent: | Object |
Rack::Session::Cookie provides simple cookie based session management. The session is a Ruby Hash stored as base64 encoded marshalled data set to :key (default: rack.session). When the secret key is set, cookie data is checked for data integrity.
Example:
use Rack::Session::Cookie, :key => 'rack.session', :domain => 'foo.com', :path => '/', :expire_after => 2592000, :secret => 'change_me' All parameters are optional.
# File lib/rack/session/cookie.rb, line 24 24: def initialize(app, options={}) 25: @app = app 26: @key = options[:key] || "rack.session" 27: @secret = options[:secret] 28: @default_options = {:domain => nil, 29: :path => "/", 30: :expire_after => nil}.merge(options) 31: end