Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sessions fix for Rails 2.3.9 apps
# patch for Rails 2.3.9 (ticket #5581)
# (drop in your config/initializers/ dir)
affected = %w[ActiveRecord::SessionStore ActionController::Session::MemCacheStore]
target = Rails.configuration.middleware.detect do |mid|
mid.klass.is_a? Class and affected.include? mid.klass.to_s
end
if target
class RailsCookieMonster
def initialize(app)
@app = app
end
def call(env)
# monster MUST HAVE COOKIES om nom nom nom
env['HTTP_COOKIE'] ||= ""
@app.call(env)
end
end
Rails.configuration.middleware.insert_before target, RailsCookieMonster
end
@josh

This comment has been minimized.

Copy link

commented Sep 8, 2010

Ha, I totally wrote the same thing!

http://gist.github.com/570160

@josh

This comment has been minimized.

Copy link

commented Sep 8, 2010

Maybe not, mine eats response cookies.

@mislav

This comment has been minimized.

Copy link
Owner Author

commented Sep 8, 2010

OM NOM NOM NOM

@elisehuard

This comment has been minimized.

Copy link

commented Sep 13, 2010

thanks !

@cdarne

This comment has been minimized.

Copy link

commented Sep 16, 2010

Thanks a lot :D

@abcreddy

This comment has been minimized.

Copy link

commented Jul 24, 2013

Thanks a lot...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.