Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of values with periods in framework.session.name configuration #27023

Closed
ostrolucky opened this issue Apr 23, 2018 · 0 comments
Closed

Comments

@ostrolucky
Copy link
Contributor

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version any
framework:
  session:
    name: "name.with.dots"

Session#name will contain name as specified. However, cookie will be saved into attribute bag as "name_with_dots", so Symfony won't ever find corresponding session. This is apparently normal for global vars in PHP.

This is similar to #9009 and #6908. However, in this case it should be normalized/disallowed on Config level, otherwise it's not obvious why sessions don't work.

fabpot added a commit that referenced this issue May 17, 2018
This PR was merged into the 2.7 branch.

Discussion
----------

Disallow invalid characters in session.name

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27023
| License       | MIT
| Doc PR        |

PHP saves cookie with correct name, but upon deserialization to
`$_COOKIE`, it replaces "." characters with "_".

This is probably also reason why \SessionHandler is not able to find
a session.

https://harrybailey.com/2009/04/dots-arent-allowed-in-php-cookie-names/
https://bugs.php.net/bug.php?id=75883

Commits
-------

16ebb43 Disallow illegal characters like "." in session.name
@fabpot fabpot closed this as completed May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants