PHP is not saving my session data ?
7 June 2004, 12:50 am IST
User Rating: 8.0 (7 votes)
Make sure that you have specified the session.save_path setting in your php.ini file and that it has write permission.
On *nix systems, following is default setting:
session.save_path = "/tmp"
However on windows system, you can set this to you choice of directory.
session.save_path = "D:/temp-sessions"
In case you don't have access to php.ini file, you can use the ini_set() function to set your setting:
<?php ini_set('session.save_path', '/tmp'); ?>
But make sure that PHP has write access on that directory.
P.S.: Generally it is adviced, not to use the default setting of /tmp, as it may have security and privacy implications, as any person, program or script will be able to read the data stored in your sessions files.


