# Net::HTTP client side sessions?

**URL:** <https://www.ruby-forum.com/t/net-http-client-side-sessions/98618>\
**Category:** Ruby\
**Created:** [July 16, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/net-http-client-side-sessions/98618 "2006-07-16T23:03:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [July 16, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/net-http-client-side-sessions/98618/1 "2006-07-16T23:03:27Z")

</div>

Been looking through Net::HTTP for a way to manage a session [i.e. cookies] on the client side but haven’t had much luck… Could anyone  
point me in the right direction for a way to [short of writing it from  
scratch of course] maintain a session id on the client side, i.e. I want  
to be able to have my script engage in a session, e.g. logs in, makes a  
post, etc [all stuff that requires my session is still valid]…

Thanks

---

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [July 17, 2006, 2:34am UTC](https://www.ruby-forum.com/t/net-http-client-side-sessions/98618/2 "2006-07-17T02:34:52Z")

</div>

On Mon, Jul 17, 2006 at 06:03:41AM +0900, Brez! !! wrote:

> Been looking through Net::HTTP for a way to manage a session [i.e. cookies] on the client side but haven’t had much luck… Could anyone  
> point me in the right direction for a way to [short of writing it from  
> scratch of course] maintain a session id on the client side, i.e. I want  
> to be able to have my script engage in a session, e.g. logs in, makes a  
> post, etc [all stuff that requires my session is still valid]…
> 
> Thanks

Have you tried looking at WWW::Mechanize? It will maintain your cookies  
for you.

[http://mechanize.rubyforge.org/](http://mechanize.rubyforge.org/)

–Aaron

---

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [July 17, 2006, 7:38pm UTC](https://www.ruby-forum.com/t/net-http-client-side-sessions/98618/3 "2006-07-17T19:38:50Z")

</div>

> [http://mechanize.rubyforge.org/](http://mechanize.rubyforge.org/)

Perfect - thanks Aaron
