1

Is there a PHP library that can keep the cookie jar in memory instead of on disk? The curl library seems to only be able to keep the cookie jar on disk.

The library should be able to handle HTTP cookies, redirects and SSL. Do not suggest therefore to use fsockopen().

rustyx
  • 80,671
  • 25
  • 200
  • 267

3 Answers3

1

Is there a PHP equivalent of Perl's WWW::Mechanize? lists a few alternatives (Snoopy and ScriptableBrowser). Maybe PEARs HTTP_Request2 would also do, albeit I didn't see a CookieJar adapter at first.

ZendFrameworks is supposed to have one. As does phpQuery by using it. http://code.google.com/p/phpquery/wiki/WebBrowser

Community
  • 1
  • 1
mario
  • 144,265
  • 20
  • 237
  • 291
  • Thanks! SimpleTest (first link) seems to be able to do what I needed. Who would've thought that one can do SSL using fsockopen("tls://")! – rustyx Dec 13 '10 at 06:38
0

Generally the advantage of keeping cookies on disk is to automate the process. I don't know why do you want an alternate method, but an alternative would be to use shell_exec() and -b argument to pass cookies manually:

curl -b "name=Daniel" www.sillypage.com

Although, I don't know how you can get the response cookie, unless you parse manually the header.

s3v3n
  • 8,203
  • 5
  • 42
  • 56
0

I did a quick google search => Any way to keep curl's cookies in memory and not on disk. Might help you.

Else maybe you could consider something like node.js?

Community
  • 1
  • 1
Alfred
  • 60,935
  • 33
  • 147
  • 186