cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Cookie jar problem

From: Andrey Kravchuk <dushik_at_gmail.com>
Date: Mon, 21 Nov 2005 14:34:38 +0200

Got a strange problem with storing cookies during login process
POST looks like this:

$this->ch = curl_init();
curl_setopt($this->ch, CURLOPT_HEADER, true);
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->cookie_jar);

curl_setopt($this->ch, CURLOPT_POST, true);
curl_setopt($this->ch, CURLOPT_HTTPGET, false);
curl_setopt($this->ch, CURLOPT_URL, $url);
curl_setopt($this->ch, CURLOPT_REFERER, $this->last_url);
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data);

 $this->last_reply = curl_exec($this->ch);

The headers i receive in reply look like this:

HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Mon, 21 Nov 2005 12:23:06 GMT

HTTP/1.1 302 Object Moved
Server: Microsoft-IIS/5.0
Date: Mon, 21 Nov 2005 12:23:06 GMT
Connection: close
Content-type: text/html
Cache-Control: private
Expires: Thu, 30 Sep 1999 01:29:07 GMT
Pragma: no-cache
Page-Completion-Status: Normal
Set-cookie: VAR=VALUE; domain=.example.com; path=/; HttpOnly
location: http://example.com/some/path
Page-Completion-Status: Normal
Set-Cookie: VAR2=VALUE2
...and some more cookies here

And cookie jar file is not created after that. Not a file permissions
issue - in all other cases cookie jar file is created.

CURL Information libcurl/7.11.2 OpenSSL/0.9.7g zlib/1.1.4

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2005-11-21