I have a script that saves session data, and it works fine on a couple of different hosted webservers I've used it on, but I when using my local install of PHP using XAMPP for OS X, the session data does not persist between pages. (I set the session data on one page, and it no longer exists on the next page.) What do I need to change to get the session data to be saved properly?
I am calling session_start() in every script, and I specified the save directory using
$docroot = $_SERVER['DOCUMENT_ROOT'];
$tmpdir = "$docroot/tmp";
session_save_path($tmpdir);
and set full permissions on this directory, and when I run the script, three session files get created in this directory, but still the session data does not persist between pages.
my webhost php.ini (sessions work fine)
php.ini for my local php installation using xampp (sessions not working)
I should also mention that a cookie I create using setcookie() works fine, but the PHPSESSID cookie never appears.