Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Try to use action dispatch cookie jar first, fall back to new rack re…

…quest

Rails 3.2.3 puts a cookie jar in @env, which we can use directly.
It also removes what we need from @env prior to this point, so the
old approach won't work.

Anything other than rails 3.2.x (other rack apps?) which mutate @env in a
way that populated action_dispatch.cookies will have to deal with the
consequences.
  • Loading branch information...
commit feef631b00aed885ae727ceaff8076621efc494f 1 parent 8bea080
@mjankowski mjankowski authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/clearance/session.rb
View
2  lib/clearance/session.rb
@@ -49,7 +49,7 @@ def remember_token
end
def cookies
- @cookies ||= Rack::Request.new(@env).cookies
+ @cookies ||= @env['action_dispatch.cookies'] || Rack::Request.new(@env).cookies
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.