Adding cookies net/http

Hi,
when I call different pages I get on response [“set-cookie”] so i need
to add the new cookies to my http connection by doing:

headers={‘Cookie’=>resp.response[“set-cookie”]}

and then when I call post or get methods pass my headers

But when I give the new cookies I think I’m missing the old ones, how
can I keep all cookies on my connection?

Thanks

How about using Mechanize, which automatically stores cookies and adds
them to requests?

If you want to store cookies by hand, check out this post:

http://stackoverflow.com/questions/1486703/how-to-implement-cookie-support-in-ruby-net-http

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs