|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75883 Documentation about name of a session should be less restrictive
Submitted: 2018-01-29 09:03 UTC Modified: 2019-01-02 00:55 UTC
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: thomas dot gerbet at enalean dot com Assigned:
Status: Open Package: Session related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-01-29 09:03 UTC] thomas dot gerbet at enalean dot com
From manual page:

Documentation mentions that only alphanum chars should be used as a session name since the name can be used in URLs and cookies.
This is a bit too restrictive and prevent for example to use the cookie prefixes restriction [1] browser feature.

According to RFC1738 and RFC3986 the characters $-_.+!*'(), should also be safe to use in URLs and it seems that RFC6265 does not add more limitations for cookies. These characters can probably be added to the documentation as "safe to use" as the name of a session.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-12 17:35 UTC] gadelat at gmail dot com
I believe this is due to legacy reasons. In past, PHP had register globals settings, which means cookie names must meet PHP variable naming restrictions. This option no longer exists, so I think this restriction should be elevated.

 [2019-01-02 00:55 UTC]
-Package: Documentation problem +Package: Session related
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Oct 26 07:01:23 2020 UTC