Class: Bowtie::Middleware::Session
- Inherits:
-
Object
- Object
- Bowtie::Middleware::Session
- Defined in:
- lib/bowtie/middleware/session.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(app) ⇒ Session
Returns a new instance of Session.
3 4 5 |
# File 'lib/bowtie/middleware/session.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/bowtie/middleware/session.rb', line 7 def call(env) status, headers, response = @app.call(env) if headers['X-Bowtie-Client-Session'] env['rack.session']['user'] = JSON.parse(headers['X-Bowtie-Client-Session'].first) end [status, headers, response] end |