[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Cookies - sessions- Ruby

Fred

4/27/2008 8:07:00 AM

Hi,

In the cookies file, i have my settings to connect to an site.

User, password, cid and sid.
The problem is the sid, that change everytime depending if i have
connected again or closed the browser.

Is it possible to programs something dynamically, so that in my rb file
the sid is picked up automatically?

For instance i'm connected to this site through my ruby program.
Now if i log in on an other computer my ruby programs fail, because the
sid is not correct anymore.
18 Answers

Herb Martin

4/28/2008 6:37:00 AM

0


"Fred" <nospam@gmail.com> wrote in message
news:48142f2e$0$24004$8a7afdce@news4.usenet4u.nl...
> Hi,
>
> In the cookies file, i have my settings to connect to an site.
>
> User, password, cid and sid.
> The problem is the sid, that change everytime depending if i have
> connected again or closed the browser.
>
> Is it possible to programs something dynamically, so that in my rb file
> the sid is picked up automatically?
>
> For instance i'm connected to this site through my ruby program.
> Now if i log in on an other computer my ruby programs fail, because the
> sid is not correct anymore.

Google: [ ruby libcurl ]



Roger Pack

4/28/2008 3:58:00 PM

0

could ask this on the rails list. I think the answer might be Restful
or something like that.

On Sun, Apr 27, 2008 at 2:10 AM, Fred <nospam@gmail.com> wrote:
> Hi,
>
> In the cookies file, i have my settings to connect to an site.
>
> User, password, cid and sid.
> The problem is the sid, that change everytime depending if i have connected
> again or closed the browser.
>
> Is it possible to programs something dynamically, so that in my rb file the
> sid is picked up automatically?
>
> For instance i'm connected to this site through my ruby program.
> Now if i log in on an other computer my ruby programs fail, because the sid
> is not correct anymore.
>
>

Fred

4/28/2008 4:24:00 PM

0

Herb Martin schreef:
> "Fred" <nospam@gmail.com> wrote in message
> news:48142f2e$0$24004$8a7afdce@news4.usenet4u.nl...
>> Hi,
>>
>> In the cookies file, i have my settings to connect to an site.
>>
>> User, password, cid and sid.
>> The problem is the sid, that change everytime depending if i have
>> connected again or closed the browser.
>>
>> Is it possible to programs something dynamically, so that in my rb file
>> the sid is picked up automatically?
>>
>> For instance i'm connected to this site through my ruby program.
>> Now if i log in on an other computer my ruby programs fail, because the
>> sid is not correct anymore.
>
> Google: [ ruby libcurl ]
>
>
>
I can't get this too work.
Thnx anyway

Fred

4/28/2008 4:25:00 PM

0

Which list is this?
thnx

Roger Pack schreef:
> could ask this on the rails list. I think the answer might be Restful
> or something like that.
>
> On Sun, Apr 27, 2008 at 2:10 AM, Fred <nospam@gmail.com> wrote:
>> Hi,
>>
>> In the cookies file, i have my settings to connect to an site.
>>
>> User, password, cid and sid.
>> The problem is the sid, that change everytime depending if i have connected
>> again or closed the browser.
>>
>> Is it possible to programs something dynamically, so that in my rb file the
>> sid is picked up automatically?
>>
>> For instance i'm connected to this site through my ruby program.
>> Now if i log in on an other computer my ruby programs fail, because the sid
>> is not correct anymore.
>>
>>
>

Roger Pack

4/28/2008 4:33:00 PM

0

curl allows you to save cookies to a file then reload them, if that's useful.
What exactly are you trying to accomplish?

> > Google: [ ruby libcurl ]

Avdi Grimm

4/28/2008 4:38:00 PM

0

On Mon, Apr 28, 2008 at 12:30 PM, Fred <nospam@gmail.com> wrote:
> Which list is this?

This is the Ruby language list. You can find the Rails mailing list here:
http://groups.google.com/group/rubyon...

--
Avdi

Home: http:...
Developer Blog: http:.../devblog/
Twitter: http://twitte...
Journal: http://avdi.livej...

Fred

4/28/2008 4:56:00 PM

0

Avdi Grimm schreef:
> On Mon, Apr 28, 2008 at 12:30 PM, Fred <nospam@gmail.com> wrote:
>> Which list is this?
>
> This is the Ruby language list. You can find the Rails mailing list here:
> http://groups.google.com/group/rubyon...
>

Thank you

Fred

4/28/2008 4:56:00 PM

0

Roger Pack schreef:
> curl allows you to save cookies to a file then reload them, if that's useful.
> What exactly are you trying to accomplish?
>
>>> Google: [ ruby libcurl ]
>

Hi,

In the cookies file, i have my settings to connect to an site.

User, password, cid and sid.
The problem is the sid, that change everytime depending if i have
connected again or closed the browser.

Is it possible to programs something dynamically, so that in my rb file
the sid is picked up automatically?

For instance i'm connected to this site through my ruby program.
Now if i log in on an other computer my ruby programs fail, because the
sid is not correct anymore.

Herb Martin

5/1/2008 9:48:00 AM

0


"Fred" <nospam@gmail.com> wrote in message
news:481601aa$0$21692$8a7afdce@news4.usenet4u.nl...
> Roger Pack schreef:
>> curl allows you to save cookies to a file then reload them, if that's
>> useful.
>> What exactly are you trying to accomplish?
>>
>>>> Google: [ ruby libcurl ]
>>
>
> Hi,
>
> In the cookies file, i have my settings to connect to an site.
>
> User, password, cid and sid.
> The problem is the sid, that change everytime depending if i have
> connected again or closed the browser.

Presuming that "sid" is a Session ID from the site -- but more importantly
it is a COOKIE being saved by a normal browser and you need to
access the site programmatically from Ruby.

I use Curl (LibCurl really) from PHP regularly, but IF you can get the
libraries to work with Ruby (at all) then it should work similarly.

By setting options, one can get LibCurl to autosave and autouse the
cookies to/from a file thus making it work pretty much like an
ordinary browser but from within a programming language (e.g., Php
or maybe Ruby.)

> Is it possible to programs something dynamically, so that in my rb file
> the sid is picked up automatically?

Yes. You could also use libcurl and just extract the cookies yourself
if you know what their names are or a pattern to pick them up, then
set them manually, but using the autosave (to file) feature is much
less trouble.

> For instance i'm connected to this site through my ruby program.
> Now if i log in on an other computer my ruby programs fail, because the
> sid is not correct anymore.

Why you would be using "an other computer" is not explained here, but
if you export the Sid-cookie to a file you could make it available on
another machine (if you move it there.)


wy

3/11/2011 12:13:00 AM

0

On Mar 10, 7:04 pm, David Hartung <david@hotmai*l.com> wrote:
> On 03/10/2011 03:19 PM, M.I. Wakefield wrote:
>
>
>
>
>
> > "Phil"<clayno...@gmail.com>  wrote in message
> >news:eccb34b4-6b26-4854-a247-0376a97b3e55@y36g2000pra.googlegroups.com...
> >> The passage of this- anti government union bill is a huge victory for
> >> taxpayers in Wisconsin and could resonate
> >> accross the nation. According to conservative Ann Coulter no  longer
> >> will uniionized bus drivers for government
> >> workers be making $150,000 dollars a year at the expense of the
> >> already strapped Wisconsin taxpayer..
>
> >> Read more below;
>
> >>http://www.foxnews.com/politics/2011/03/09/wisconsin-republ......
>
> > Walker may yet learn the meaning of the word "pyrrhic" ... polls show that
> > if the election were re-held today, he'd lose by as big a margin as he won
> > by just four months ago.
>
> > Meanwhile, organizers claim that they collected 15% of the signatures
> > required to trigger recall elections for eight republican state senators
> > just last weekend ... aiming for 10,000, and getting over 13,500.
>
> They claim. Are these the same folks who illegally walked off their jobs
> to harass the duly elected representatives of the state? Why should we
> give such irresponsible people any credibility.

You don't believe in The American Way, do you? What are you, a
Communist? Or do you sorely miss your heart throb, Saddam Hussein?