I'm trying to use the HttpRequest class to make a site availability checker, but to make sure the target site is working properly I need to store cookies. This was easy enough with:
Code: Select all
$request = new HttpRequest($url, HTTP_METH_POST, array('referer' => 'http://www.mysite.abc/index.php', 'cookiestore' => './mysite_cookies'));
The problem is it doesn't create the file. If I create an empty file for it, all it does is read it (I debugged the process to find that out) yet it still stores the cookies somewhere, because they're present in all the raw messages. I need to be able to clear the cookie store when a session has expired, and without it actually storing the cookies in the file I've told it to, I can't figure out how to do that.