Sha256: 34d6a636427a594da05d3d3ef71ab4bd3606dcdb9773b79c704cc594b5c85cb1

Contents?: true

Size: 483 Bytes

Versions: 19

Compression:

Stored size: 483 Bytes

Contents

require 'rack/request'

module Rack 
  class FacebookSession
  
    FACEBOOK_SESSION_KEY = 'fb_sig_session_key'
  
    def initialize(app, session_key = '_session_id')
      @app = app
      @session_key = session_key
    end

    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
  end
end

Version data entries

19 entries across 19 versions & 7 rubygems

Version Path
facebooker-rails3-1.0.64 lib/rack/facebook_session.rb
facebooker-1.0.69 lib/rack/facebook_session.rb
cbaclig-facebooker-1.0.67.3 lib/rack/facebook_session.rb
facebooker-1.0.68 lib/rack/facebook_session.rb
cbaclig-facebooker-1.0.67.2 lib/rack/facebook_session.rb
facebooker-lite-1.0.67.2 lib/rack/facebook_session.rb
facebooker-lite-1.0.67.1 lib/rack/facebook_session.rb
facebooker-lite-1.0.67 lib/rack/facebook_session.rb
fotonauts-facebooker-1.0.67 lib/rack/facebook_session.rb
facebooker-1.0.67 lib/rack/facebook_session.rb
facebooker-1.0.66 lib/rack/facebook_session.rb
jet-facebooker-1.0.64 lib/rack/facebook_session.rb
facebooker-1.0.65 lib/rack/facebook_session.rb
facebooker-1.0.64 lib/rack/facebook_session.rb
facebooker-1.0.63 lib/rack/facebook_session.rb
facebooker-1.0.62 lib/rack/facebook_session.rb
facebooker-fbg1-1.0.61.1 lib/rack/facebook_session.rb
facebooker-1.0.61 lib/rack/facebook_session.rb
facebooker-1.0.60 lib/rack/facebook_session.rb