How to handle multiple "set-cookie" headers

You could .split() the string that’s in that entry. I actually did some
more serious modification of Net::HTTP for other purposes, but I don’t
think I did anything special to deal with multiple Set-Cookie headers,
because I wasn’t really concerned with them.

Al

···

From: Matt Lawrence
Reply To: ruby-talk@ruby-lang.org
Sent: Tuesday, February 4, 2003 1:21 PM
To: ruby-talk ML
Subject: How to handle multiple “set-cookie” headers

I’m trying to write an automated web tool that will fetch data for me.

The site I’m getting data from returns multiple “set-cookie” headers
which
are then appended into a single hash entry. How do I split the
various
cookies back up? This is using 1.6.7 and net/http.

Thanks,
Matt Lawrence

The problem is figuring out exactly where to split the entry. There are
the “path=” and “expires” tags mixed in.

– Matt

···

On Thu, 6 Feb 2003, Albert Chou wrote:

You could .split() the string that’s in that entry. I actually did some
more serious modification of Net::HTTP for other purposes, but I don’t
think I did anything special to deal with multiple Set-Cookie headers,
because I wasn’t really concerned with them.