Skip to content

Instantly share code, notes, and snippets.

@tsmango
Created September 4, 2009 02:16
Show Gist options
  • Save tsmango/180692 to your computer and use it in GitHub Desktop.
Save tsmango/180692 to your computer and use it in GitHub Desktop.
require 'rack/utils'
class FacebookCookielessSessionMiddleware
def initialize(app, session_key = '_session_id')
@app = app
@session_key = session_key
end
def call(env)
params = Rack::Request.new(env)
unless params[@session_key].nil?
env[ENV_SESSION_OPTIONS_KEY].merge({:id => params[@session_key]})
end
@app.call(env)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment