Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] Fix session initialized several times#38910

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:4.4fromjderusse:sess-fix
Nov 2, 2020

Conversation

@jderusse
Copy link
Member

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

The session injected in the request is a factory. When the request iscloned (ie sub-request) while the session is not yet used in the master request (the session is still a factory), both Master and Sub request will have a factory.
If both requests attempt to read the session afterward, they both triggers the factory, and both initialize the session.

It's not a dead end for theSessionListener because the session come from the container and is shared, but:

  • the session is initialized ($storage->setOptions(['cookie_secure' => true])) twice
  • if we replace the sesssion from container to a factory, it could be an issue

ro0NL reacted with thumbs up emoji
@carsonbotcarsonbot added this to the4.4 milestoneOct 30, 2020
@jderussejderusse changed the title[HttpKernel] Fix session called initized several time[HttpKernel] Fix session called initialized several timeOct 30, 2020
@jderussejderusse changed the title[HttpKernel] Fix session called initialized several time[HttpKernel] Fix session called initialized several timesOct 30, 2020
@Nyholm
Copy link
Member

Could I ask you for a test too?

jderusse reacted with thumbs up emoji

@jderussejderusse changed the title[HttpKernel] Fix session called initialized several times[HttpKernel] Fix session initialized several timesOct 30, 2020
@nicolas-grekas
Copy link
Member

Thank you@jderusse.

@nicolas-grekasnicolas-grekas merged commit5831ab2 intosymfony:4.4Nov 2, 2020
useSymfony\Component\HttpFoundation\Session\Session;
useSymfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
useSymfony\Component\HttpKernel\Event\FinishRequestEvent;
useSymfony\Component\HttpKernel\Event\GetResponseEvent;
Copy link
Member

@nicolas-grekasnicolas-grekasNov 2, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This class is deprecated, I'm fixing it in the source directly, see76c1939

jderusse reacted with thumbs up emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@jderusse@Nyholm@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp