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:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
45 - 42 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Wed Aug 21 22:01:26 2019 UTC