Link to home
Start Free TrialLog in
Avatar of RWJDCom
RWJDComFlag for United States of America

asked on

cURL Cookie Storage Question

I have a script using cURL to login to a web site that uses cookies to store login information and grabs several bandwidth usage images (charts).

Now, this is the setting that I have in my script that sets the cookiejar file...
   curl_setopt($ci, CURLOPT_COOKIEJAR, "/tmp/cookies.txt");

Since the login form gets submitted everytime I run the script, would it be possible to store the cookiejar in memory rather than in a file?  I'd rather store the cookies in memory than in a file.

Thanks,

Jeff
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Not sure if you can using any of the curl options.

If it actaully is the case that curl cannot suport this, then you can use stream_wrappers and use

curl_setopt($ci, CURLOPT_COOKIEJAR, "var://cookie");

This based on the streamwrapper for var:// as defined in http://php.net/manual/en/function.stream-wrapper-register.php

-r-
ASKER CERTIFIED SOLUTION
Avatar of Giovanni G
Giovanni G
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RWJDCom

ASKER

I'm not really concerned about security, I just don't want to have a file for the cookies...
Avatar of RWJDCom

ASKER

I'm going to check out that memory module.