php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26757 session.save_path should default to %TEMP%
Submitted: 2003-12-31 15:19 UTC Modified: 2004-03-29 16:37 UTC
Votes:47
Avg. Score:4.5 ± 0.8
Reproduced:40 of 42 (95.2%)
Same Version:32 (80.0%)
Same OS:33 (82.5%)
From: unknown at simplemachines dot org Assigned:
Status: Closed Package: Session related
PHP Version: 4CVS, 5CVS OS: Windows
Private report: No CVE-ID: None
 [2003-12-31 15:19 UTC] unknown at simplemachines dot org
Description:
------------
I would like to request that, much like upload_tmp_dir, PHP be changed so that session.save_path defaults to the system's default temp directory.

The reason for this is simple; countless times, people on Windows machines have problems with sessions because they do not set the path in php.ini. (even with how documented it is.)  I mean - I am a developer for forum software, and more than half of the reported installation problems are caused by this one issue alone.

Thus, with this change, php.ini-dist and php.ini-recommended could have no path set by default, and it would work fine on both operating systems without any changes.

I realize this is basically a dupe of bug 25574, but in that case, the reporter misread the manual.  I am asking that it be changed to work.
http://bugs.php.net/bug.php?id=25574

Thank you,
Unknown W. Brackets


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-14 00:44 UTC] unknown at simplemachines dot org
A diff for a recent cvs version can be found here:

http://unknown.network32.net/php_session_save_path_diff.txt

This diff has the following affects:
  - any call to session_start() or session_save_path() will set the setting to the Windows/*nix temporary directory, unless it's otherwise specified.
  - if ini_get('session.save_path') is called before this happens, it will return an empty string; afterward, it will return the path used.

I have tested this on Windows 2003 Server, in ISAPI/CGI, with and without using user-defined session functions.

It should work on Linux/Unix as well, although I haven't had a chance to recompile PHP on any Linux/Unix machine with this patch.  It uses the same method to get the path that  upload_tmp_dir uses, however.

Thank you,
-[Unknown]
 [2004-02-17 03:14 UTC] unknown at simplemachines dot org
Maybe someone will read this if I say 4CVS, 5CVS instead of Irrelevant.
 [2004-03-29 04:58 UTC] unknown at simplemachines dot org
I'm sorry, I just feel that with 47 votes (as of now) and even a provided working patch, a comment from a developer would be nice.

Changing the category to "Session related" in the hopes that it not only will be looked at there, but also will receive some notice.  Was previously a "Feature/Change Request".

Thanks again,
-[Unknown]
 [2004-03-29 07:25 UTC] wez@php.net
Please try this patch against latest stable CVS:
http://www.php.net/~wez/session-files-fix-4.3.diff
I also have an equivalent for PHP 5.

This is slightly different from your patch, as it
doesn't obliterate non file-based session save paths.

 [2004-03-29 09:56 UTC] unknown at simplemachines dot org
After I applied that patch, and changed session.save_path in my php.ini to nothing, it did indeed work without trouble.

However, if I renamed php.ini to php_.ini, and tried it... it of course went back to the default /tmp - but if the default is changed to NULL without handling it, crashes will result...

My purpose here is to make it easier for people, mainly, to test PHP on their own computers without running into funny errors.  That means default values, because some people will never read the manual.... which is why I did it as I did in my patch.

Thanks for replying,
-[Unknown]
 [2004-03-29 16:37 UTC] wez@php.net
Fixed in CVS.
The new default for save_path in upcoming releaess
will be the empty string, which causes the temporary
directory to be probed.

Thanks for your patch.
 [2004-04-19 21:26 UTC] LarryJAdams at comcast dot net
I hear party favors going off somewhere...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC