Forum: Ruby on Rails Cookies with the same name, but different paths

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
jhosteny (Guest)
on 2005-11-12 12:49
(Received via mailing list)
I have an application that may need to set multiple cookies in one
response with the same name (but different paths, obviously). I
looked at the cookie code in action_controller, and it clearly is
returning only the first cookie in the value array. I also looked a
little bit through the CGI code, and it seems to indicate that it
handles multiple cookies with the same name (especially since it
returns the cookies under one name in an array).

However, even with a local patch to the cookie.rb file, I couldn't
get my controller's action to recognize anything but the last cookie
returned by the client (curl, in this case). I will be digging
through the code more tomorrow, but I'm in a bit of a hurry for an
answer - does anyone know if the Ruby CGI code does indeed handle
multiple cookies with the same name properly? Is this just something
that needs to be patched in Rails?

Thanks,
Joe
This topic is locked and can not be replied to.