Class Rack::FacebookSession
In: lib/rack/facebook_session.rb
Parent: Object

Methods

call   new  

Constants

FACEBOOK_SESSION_KEY = 'fb_sig_session_key'

Public Class methods

[Source]

# File lib/rack/facebook_session.rb, line 8
    def initialize(app, session_key = '_session_id')
      @app = app
      @session_key = session_key
    end

Public Instance methods

[Source]

# File lib/rack/facebook_session.rb, line 13
    def call(env)
      req = Rack::Request.new(env)
      key = req.POST[FACEBOOK_SESSION_KEY] || req.GET[FACEBOOK_SESSION_KEY]
      env['HTTP_COOKIE'] = [ @session_key, key ].join('=').freeze unless key.nil?
      
      @app.call(env)
    end

[Validate]