php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68221 session.save_path has bad advice for directory level depths
Submitted: 2014-10-14 01:22 UTC Modified: 2014-10-23 19:06 UTC
From: greenreaper at hotmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: greenreaper at hotmail dot com
New email:
PHP Version: OS:

 

 [2014-10-14 01:22 UTC] greenreaper at hotmail dot com
Description:
------------
---
From manual page: http://www.php.net/session.configuration
---
The description of session.save_path gives an infeasible suggestion for the depth of the session directory tree: 

"There is an optional N argument to this directive that determines the number of directory levels your session files will be spread around in. For example, setting to '5;/tmp' may end up creating a session file and location like /tmp/4/b/1/e/3/sess_4b1e384ad74619bd212e236e52a5a174If ."

People may try to use this kind of figure without thinking about what they're doing. They probably won't be *able* to create 64^5 directories, but once they find that out, they may be tempted to split the difference - even 64^3 is over 1Gb and 256k inodes on most systems, just for the structure.

Something like "If you're considering a value beyond 1 or 2, you may want to look into a different session.save_handler." would be helpful.

Also, the dir_indexes option for ext2/3/4 can help with large session directories, though I don't know if PHP gives such specific advice.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-10-23 19:06 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=335126
Log: Add a cautionary note about configuring session.save_path.

Fixes doc bug #68221 (session.save_path has bad advice for directory level
depths).
 [2014-10-23 19:06 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2014-10-23 19:06 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 01:00:01 2026 UTC