problem setting multiple cookies

Eric Wong normalperson at
Tue Jun 21 14:29:49 EDT 2011

Jason Su <jason at> wrote:
> I'm using unicorn 3.6.2
> What I was trying to say is that the JoinCookie middleware didn't do
> anything. headers["Set-Cookie"] is a string, and the _test_session
> cookie was always being set correctly. The problem happens only when I
> try to set multiple cookies myself.

Yeah, you're not getting an Array (at least not at that stage) as I
semi-hoped so JoinCookie wouldn't solve it.

> Here's the output of p headers in JoinCookie again
> {"X-Runtime"=>"92", "Content-Type"=>"text/html",
> "Content-Length"=>"1", "Set-Cookie"=>"first=;;
> path=/; expires=Thu, 01-Jan-1970 00:00:00 GMTsecond=1;
>; path=/; expires=Mon, 21-Jun-2021 03:35:30
> GMT\n_test_session=1804126e6bad8cf4b25602b74218f003;;
> path=/; HttpOnly", "Cache-Control"=>"no-cache"}
> Where is JoinCookie is getting it's headers from? is what dispatches your Rails app, so the headers are what
Rails (and middlewares further down the stack) sets.

Any luck with looking at Rails changes that might impact this?

At this point it's clear it's a Rails/Rack issue (and for an old
version, at that) and not something that can be done with Unicorn.

Maybe you can fix whatever the Rails v2.3.8..v2.3.11 upgrade broke
in your app, but whatever's broken is broken at the application layer
and not in Unicorn.

Eric Wong

More information about the mongrel-unicorn mailing list