Set-Cookie issues #4

kris opened this Issue Feb 3, 2010 · 1 comment


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

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.



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:

I used a piece of custom middleware to fix it:

jodosha closed this Jan 18, 2013

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