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

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]
[Veltro]: usemodperl I think you are offensive right now.
[marto]: people are very defnsive about their bad ideas behaviour' :P
[usemodperl]: sorry veltro, venting...
[usemodperl]: (is that wrong marto?)
[aitap]: usemodperl: maybe it's you who has changed
[marto]: demonstrably yes, since you claim to want a safe space, your definition for which seems to be a place where you can name call, make things up or otherwise post without being challenged
[usemodperl]: no that's not it at all, meant safe for perl people, to not be hounded by weirdos obsessed with things like... whitespace :-)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-06-24 15:54 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.