PDA

View Full Version : Retaining SESSION using cURL



AikenD
06-04-2007, 12:21 PM
Hi guys - I am a bit of a newbie to PHP - so please go gently - I have been searching / reading / asking - late nights etc

Is there any way to retain SESSION information when using the cURL method of fetching a URL (POST) ?

I was using header(location: etc) to redirect me to another page, but this shows information in the address bar that I would rather not show

So, I tried the cURL method, which works, but loses the SESSION when I want to go to another page from the page used in the cURL !

Any help, smacks over the head or cuff around the lugs greatly appreciated

AikenD

Twey
06-04-2007, 12:26 PM
To preserve a session, all that's necessary is to pass the PHPSESSID variable via GET or cookie. The name of this variable does differ between configurations, but by far the most common is simply the default PHPSESSID.