Set-Cookie issues #4

Closed
kris opened this Issue Feb 3, 2010 · 1 comment

Comments

Projects
None yet
3 participants

kris commented Feb 3, 2010

I can only assume this has to do with redis-store because it only pops up with redis-store. When I run cucumber, I get errors from webrat about `visit page_path(page_name)', and when running cucumber with -b, I get an error that points to:

/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/integration.rb:327:in `process'

Which is:

(@headers['Set-Cookie'] || "").split("\n").each do |cookie|
name, value = cookie.match(/^([^=])=([^;]);/)[1,2]
@Cookies[name] = value
end

More precisely:

name, value = cookie.match(/^([^=])=([^;]);/)[1,2]

The issue is that @headers['Set-Cookie'] is returning:

" \nfoo=bar;"

So, `(@headers['Set-Cookie'] || "").split("\n").each do |cookie|' is passing an empty string to cookie, and then grabbing a MatchData#[] on an empty set raises an error.

Sessons break. Is this an issue with redis-store? I don't have this issue anywhere else.

Thanks!

Contributor

agibralter commented Jun 10, 2010

I don't think this is a redis-store issue. This came up for me with Rails 2.3.8 and Rack 1.1.0. There's a ticket open here: https://rails.lighthouseapp.com/projects/8994/tickets/4743-session-cookie-breaks-if-used-with-custom-cookie-in-rails-238

I used a piece of custom middleware to fix it: http://gist.github.com/431811

jodosha closed this Jan 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment