Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Set-Cookie issues #4

Closed
kris opened this Issue · 1 comment

3 participants

@kris

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!

@agibralter

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 jodosha closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.