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

curl-and-php

Re: how to do session based cookies (non-ssl question!)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 4 Aug 2001 16:38:50 +0200 (MET DST)

On Tue, 17 Jul 2001, Jason Sweat wrote:

> CURLOPT_COOKIEFILE works great for disk based cookies(the same ones a
> browser would save), but I was wondering if there is a similar mechanism
> for dealing with session based cookies. i.e. I want the same curl
> connection handle to send back the session cookies without my
> intervention.

If you use CURLOPT_COOKIEFILE, curl will do that. Using this option will
switch on the cookie "engine" and then libcurl will parse incoming cookies
and send back the appropriate cookies in following requests.

> So far the only luck I have had to enable headers on the page that sends
> the session based cookies and parse them out of the headers and resend
> with all subsequent requests using CURLOPT_COOKIE.

That's the manual way of doing it.

A more advanced cookie jar system is being discussed and design for
implementation this autumn. More about that can be found at:
http://curl.haxx.se/dev/cookie-jar.txt

-- 
     Daniel Stenberg -- curl dude -- http://curl.haxx.se/
_______________________________________________
Curl-and-php mailing list
http://curl.haxx.se/
Received on 2001-08-04