Permalink
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...
mjankowski committed Apr 4, 2012
1 parent 8bea080 commit feef631b00aed885ae727ceaff8076621efc494f
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/clearance/session.rb
View
@@ -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

0 comments on commit feef631

Please sign in to comment.