View Full Version : cURL with cookies

02-25-2008, 11:51 PM
What I want to happen is I want via cURL to open a URL and post values, and allow it to set a cookie (and store in a cookie jar) , then with that cookie it calls upon another URL on the same site using those cookies, and post another value to another part of the site , then echos the response (the result) , then dumps the cookies.

02-26-2008, 02:52 PM
I don't really have an example script to show, but would like to mention this...

You'll need to use two scripts.

One script is used for writing the cookie(s), the other script for displaying results.

The reason is that you can't write a cookie and display the results in the same
instance of a script ... meaning, you need one refresh to write the cookie, as it's
sent in a header. By using a separate script for writing that cookie, when it is
redirected back, you have the header you need.

just thought that might give you some ideas.