php.net |  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
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (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
 [2018-01-29 09:03 UTC] thomas dot gerbet at enalean dot com
Description:
------------
---
From manual page: http://www.php.net/function.session-name
---

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.



[1] https://tools.ietf.org/html/draft-west-cookie-prefixes


Patches

Pull Requests

History

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.

See https://harrybailey.com/2009/04/dots-arent-allowed-in-php-cookie-names/
 [2019-01-02 00:55 UTC] girgias@php.net
-Package: Documentation problem +Package: Session related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 07 02:01:27 2024 UTC