PHPSESSID – Changes between pages

If your PHPSESSID cookie inexplicably keeps changing between pages and you’ve already checked that session_start() is the very first thing in your scripts and you still can’t find it…Check that any CURL actions defines a cookie jar for storage otherwise it might overwrite any existing PHPSESSID cookie.

You do this by using:

curl_setopt($c, CURLOPT_COOKIEJAR, ‘/tmp/cookie-‘ . session_id());
curl_setopt($c, CURLOPT_COOKIEFILE, ‘/tmp/cookie-‘ . session_id());

It took me far too long to identify this issue!

Leave a Reply

Your email address will not be published. Required fields are marked *


*