go to bug id or search bugs for
When using sessions and having session.save_path to an empty value the session data won't be saved - even if session.use_only_cookies = 1
When session.save_path is specified it works fine.
print "Session-ID: ".session_id()."<br>";
$_SESSION['test'] = "example";
Array ( [test] => example )
Array ( )
Add a Patch
Add a Pull Request
Of course you have to reload after the 1st execution otherwise it's of no use :-)
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
How can you expect sessions to work if PHP cannot safe the corresponding session data?
Well it does NOT write to a file if a path is given and it should save to cookies like described, so why do you require to set this ?
Either the PHP itself or the documentation should be updated at least :-)
PHP, as described in the manual, saves session data to files in a temporary directory. (unless an alternate handler is used...) The cookie option is there to let the client know their ID and only their ID, which is used to access these files.
The option you describe, session.use_only_cookies, means it will not take session id's passed via GET. (like ?PHPSESSID=1234567890abcdef1234567890abcdef)
However, I do agree that not having session.save_path set should work; just like not having upload_tmp_dir set. If you agree, please see my bug report here: