# How to save session using open-uri

**URL:** <https://www.ruby-forum.com/t/how-to-save-session-using-open-uri/192603>\
**Category:** Ruby\
**Created:** [August 2, 2010, 11:46pm UTC](https://www.ruby-forum.com/t/how-to-save-session-using-open-uri/192603 "2010-08-02T23:46:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arpittandon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ebca7d/32.png) [@arpittandon](https://www.ruby-forum.com/u/arpittandon)\
**Post date:** [August 2, 2010, 11:46pm UTC](https://www.ruby-forum.com/t/how-to-save-session-using-open-uri/192603/1 "2010-08-02T23:46:37Z")

</div>

I am trying to pull out some information from a site.

There are 2 steps involved in order to get data from site. The first  
step is a translation of the some user id to THEIR id. After the  
translation is complete,use THEIR id to pull out information. This first  
page is performing the translation step and is then forwarding the  
results to the tool page.  
I am able to get the first page but cant save session to resubmit the  
information.  
It is required that the resubmission must be within the original api  
session as necessary session variables are also set in that first step.

How can i keep session alive?

Arpit

---

<div class="post-metadata">

**Author:** ![arpittandon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ebca7d/32.png) [@arpittandon](https://www.ruby-forum.com/u/arpittandon)\
**Post date:** [August 2, 2010, 11:56pm UTC](https://www.ruby-forum.com/t/how-to-save-session-using-open-uri/192603/2 "2010-08-02T23:56:10Z")

</div>

Try using Mechanize. It will handle all the session & cookie detail for  
you.

---

<div class="post-metadata">

**Author:** ![arpittandon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ebca7d/32.png) [@arpittandon](https://www.ruby-forum.com/u/arpittandon)\
**Post date:** [August 3, 2010, 6:15pm UTC](https://www.ruby-forum.com/t/how-to-save-session-using-open-uri/192603/3 "2010-08-03T18:15:59Z")

</div>

Thanks, it worked.

There are couple of radio button that I need to “check” and then  
generate a report by clicking another button. Below is example:

 Functional Annotation Clustering Functional Annotation Chart 

```
<tr >
  <td><button class='table' onClick="CreateTable();" type="button" 

```

value=“Functional Annotation Table” name=“B1” \> Functional Annotation  
Table

How can I “click” on 1st one- Functional Annotation Clustering?  
It might be very simple but I am having hard time to find the solution

Thanks
