hassox/rails_warden — Issue #11: Slow access to cookies
Author: LogicWolfe
Created: 2012-01-12 21:41:20+00:00
State: open

The first access to cookies is costing ~400-500ms for me right now when using Rails 3.1. The problem first started occurring when I upgraded rails. The instantiation of the controller `controller.new(self.request, self.response).send(:cookies)` on line 44 of rails_warden.rb seems to be the issue. Rewriting the function to

```ruby
def cookies
self.request.cookie_jar
end
```

resolves the issue for me, but may not be sufficiently robust. Happy to submit a pull request with that change but I suspect you'll have a better way of fixing it. Let me know if I can be of any assistance in resolving this.