Created
September 8, 2010 13:56
-
-
Save mislav/570149 to your computer and use it in GitHub Desktop.
Sessions fix for Rails 2.3.9 apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Maybe not, mine eats response cookies.
OM NOM NOM NOM
thanks !
Thanks a lot :D
Thanks a lot...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ha, I totally wrote the same thing!
http://gist.github.com/570160