Class: BonaFide::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/bona_fide/session.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Session

Returns a new instance of Session.



3
4
5
# File 'lib/bona_fide/session.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object

Called on every web request,



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/bona_fide/session.rb', line 8

def call(env)
  @env = env
  # reset cookies on each request
  @cookies = nil

  if cookie = get_cookie
    BonaFide.config.call_setter(cookie)
  end
  
  @app.call(env)
end