# Post\_form

**URL:** <https://www.ruby-forum.com/t/post-form/67991>\
**Category:** Ruby\
**Created:** [February 14, 2006, 3:13pm UTC](https://www.ruby-forum.com/t/post-form/67991 "2006-02-14T15:13:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fox](https://www.ruby-forum.com/u/fox)\
**Post date:** [February 14, 2006, 3:13pm UTC](https://www.ruby-forum.com/t/post-form/67991/1 "2006-02-14T15:13:13Z")

</div>

Hi,

I’m trying to do auto login and mail checker script to check my webmail  
account [http://webmail.razdva.cz/index.html](http://webmail.razdva.cz/index.html). So I used post\_form method  
for logging.

res = Net::HTTP.post\_form  
URI.parse(‘[http://webmail.razdva.cz/index.html](http://webmail.razdva.cz/index.html)’),  
{ “mode” =\> “login”, “username”=\>“user”,  
“password”=\>“pwd”, “secure” =\> “0” }

This call succeeds and res is HTTPFound, so I tried to download  
redirected page, but the server immediatelly logouts me. I think that  
problem is in cookies, becuase they are required by the server.  
Should I start some session prior to posting a form?

Thanks a lot,  
Fox

---

<div class="post-metadata">

**Author:** ![fox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fox](https://www.ruby-forum.com/u/fox)\
**Post date:** [February 14, 2006, 9:44pm UTC](https://www.ruby-forum.com/t/post-form/67991/2 "2006-02-14T21:44:16Z")

</div>

DÅ?a Utorok 14 FebruÃ¡r 2006 13:33 Fox napÃ­sal:

> This call succeeds and res is HTTPFound, so I tried to download  
> redirected page, but the server immediatelly logouts me. I think that  
> problem is in cookies, becuase they are required by the server.  
> Should I start some session prior to posting a form?
> 
> Thanks a lot,  
> Fox

Sessions are mostly stored server-side, so you need to re-send the  
cookies the  
server gives you back with each subsequent request.

Personally, I’d just use a Real Mail Account that lets you use POP.

David V.
