class Rack::Session::Abstract::ID

ID sets up a basic framework for implementing an id based sessioning service. Cookies sent to the client for maintaining sessions will only contain an id reference. Only get_session and set_session are required to be overwritten.

All parameters are optional.

These options can be set on a per request basis, at the location of env. Additionally the id of the session can be found within the options hash at the key :id. It is highly not recommended to change its value.

Is Rack::Utils::Context compatible.

Constants

DEFAULT_OPTIONS

Attributes

default_options[R]
key[R]

Public Class Methods

new(app, options={}) click to toggle source
# File lib/rack/session/abstract/id.rb, line 51
def initialize(app, options={})
  @app = app
  @key = options[:key] || "rack.session"
  @default_options = self.class::DEFAULT_OPTIONS.merge(options)
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack/session/abstract/id.rb, line 57
def call(env)
  context(env)
end
context(env, app=@app) click to toggle source
# File lib/rack/session/abstract/id.rb, line 61
def context(env, app=@app)
  load_session(env)
  status, headers, body = app.call(env)
  commit_session(env, status, headers, body)
end