Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PHP Session Cookie gets set despite setting use_cookies = false #45105

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

Closed
hoebelix opened this issue Jan 21, 2022 · 2 comments
Closed

PHP Session Cookie gets set despite setting use_cookies = false #45105

hoebelix opened this issue Jan 21, 2022 · 2 comments

Comments

@hoebelix
Copy link

Symfony version(s) affected

5.4

Description

Similar as in #13668, I have a small AP and I need to maintain a session without using cookies. In my case, the client passes the session ID in a custom HTTP header.

The PR #15123 added support for this use case. But despite the setting use_cookies: false, Symfony sets a PHP session cookie. This seems to be the case at least since commit b3e4f66

This commit also seems to always read the session id from the cookies - independently of use_cookies = false.

How to reproduce

In framework.yaml set

framework:
    session:
        use_cookies: false

and somewhere in a controller read the session via

$request->getSession()->all()

Possible Solution

No response

Additional Context

No response

@sergnik1995
Copy link

Experiencing this bug too

@alexander-schranz
Copy link
Contributor

Think a simple check in the listener should fix it. Can you give #45964 a try?

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