Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Maintaining sessions with WWW::Mechanize across script instances?

by trwww (Priest)
on Apr 22, 2011 at 00:54 UTC ( #900746=note: print w/ replies, xml ) Need Help??


in reply to Maintaining sessions with WWW::Mechanize across script instances?

I don't think I'd try to serialize/deserialize complicated data structure unless I knew it like the back of my hand. There are some things in perl that just can't be serialized like that. If you need it to persist, I suggest a job server like POE or a mod_perl process and storing the object in global memory. Before that though, I'd try to figure out how to store the object state and then try to reinitialize a new instance of the object. Either of those is going to be faster than dumping the raw object and reading it back.

As far as the cookies, did you look at the cookie file to make sure it looks like you want it to? You may have to muck with the WWW::Mechanize internals. But its just a wrapper around LWP, so it is pretty simple to do. I'm sure a glance at the source for those methods and maybe a couple of debugging sessions will show you what the problem is.


Comment on Re: Maintaining sessions with WWW::Mechanize across script instances?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://900746]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-09-20 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (163 votes), past polls