Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://900746]
[moritz]: maybe you should start looking at the documentation of FindBin?

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2018-03-17 20:53 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (226 votes). Check out past polls.