# Session with cookie

**URL:** <https://www.ruby-forum.com/t/session-with-cookie/129538>\
**Category:** Rails\
**Created:** [February 19, 2008, 1:10pm UTC](https://www.ruby-forum.com/t/session-with-cookie/129538 "2008-02-19T13:10:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![masch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@masch](https://www.ruby-forum.com/u/masch)\
**Post date:** [February 19, 2008, 1:10pm UTC](https://www.ruby-forum.com/t/session-with-cookie/129538/1 "2008-02-19T13:10:26Z")

</div>

Hi!.  
I wonder if it’s possible to make a program in ruby that can log in some  
page that required a cookie. Once i’m login into the page i have to  
parse  
some html, but first i need to log in, Somebody know how to do this?

Salu2…

---

<div class="post-metadata">

**Author:** ![masch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@masch](https://www.ruby-forum.com/u/masch)\
**Post date:** [February 19, 2008, 10:49pm UTC](https://www.ruby-forum.com/t/session-with-cookie/129538/2 "2008-02-19T22:49:27Z")

</div>

masch wrote:

> Hi!.  
> I wonder if it’s possible to make a program in ruby that can log in some  
> page that required a cookie. Once i’m login into the page i have to  
> parse  
> some html, but first i need to log in, Somebody know how to do this?
> 
> Salu2…

[https://rubyforge.org/projects/mechanize/](https://rubyforge.org/projects/mechanize/)

Mechanize will handle all your cookie details and follow redirects…

hth

ilan

---

<div class="post-metadata">

**Author:** ![masch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@masch](https://www.ruby-forum.com/u/masch)\
**Post date:** [February 21, 2008, 2:29pm UTC](https://www.ruby-forum.com/t/session-with-cookie/129538/3 "2008-02-21T14:29:55Z")

</div>

HOOOOORAaaayy!!!

Thanks so much Ilan!!..It’s exelent this. it;'s was what i needjust is  
just what i was looking for.

Salu2!..😃

On Tue, Feb 19, 2008 at 4:49 PM, Ilan B. \<
