Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by trwww (Priest)
on Apr 22, 2011 at 00:54 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://900746]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-26 05:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found