curl-and-php
Re: HTTP post and asp sessions
Date: Thu, 28 Feb 2002 08:42:02 +0100 (MET)
On Wed, 27 Feb 2002, Andrew Hazen wrote:
> I am using curl functions to emulate a post to a credit card processor. The
> processor uses asp sessions to maintain state through the processing. It
> seems that my posting from server-side is not accepting their session
> cookie in a way that they can check for state.
> I think this can be handled by cURL but I'm not sure which options to set
> to what.
You need to tell curl to record/parse incoming cookies, as it doesn't do that
by default.
CURLOPT_COOKIEFILE enables the cookie parser, it also specifies a file to
read initial cookies from. If the file is non-existing or empty, the parser
is enabled and no cookies will exist from the start.
CURLOPT_COOKIEJAR enables the cookie parser and specifies a file in which all
cookies are written to when the session is over. The output file will be
written using the Netscape/Mozilla cookie file format.
CURLOPT_COOKIE is used to set user-specified cookies, exactly the way you
want the receiver to receive them.
I hope this helps.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2002-02-28