PDA

View Full Version : Little Curl Issue [PHP]



Protege
26-11-2008, 11:20 AM
I've been playing around with Curl (PHP) logging into auth pages then visiting another page that is auth but I have the issue of having to relogin EVERY time, even though it takes 6 hours for the cookie set by the site to expire.

I can login once, then visit a million pages before the page is closed, but keeping that cookie info etc is being a *****

So I thought, could I return the headers from the page (showing cookies etc), then put them in the headers before visiting an auth page? (curlopt_headers)

Whats your views? Got a better method?

If you know a bit about cookiejar, explain please.

Protege
26-11-2008, 01:49 PM
Don't worry now, I figured it out by playing around with the COOKIEJAR (thought it was a dead end but I guess not) I found out you have to "open" then it will write to it, so with that I write the cookie to a file and then use COOKIEFILE to load it back in, and it works - like magic. :)

Want to hide these adverts? Register an account for free!