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

fixed example to check if the session exists when getting flash messages to avoid starting sessions when not needed#2564

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
weaverryan merged 1 commit intosymfony:2.1fromfabpot:session
May 5, 2013

Conversation

@fabpot
Copy link
Member

QA
Doc fix?yes
New docs?no
Applies toall
Fixed ticketssymfony/symfony#6036

Copy link
Member

Choose a reason for hiding this comment

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

: should be::

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

fixed

…ges to avoid starting sessions when not needed
@weaverryan
Copy link
Member

Hey guys!

Before I merge this, I want to make sure I'm not missing something. Why would the following situation not cause a problem:

  1. On one request, you set a value in the flashbag and redirect
  2. On the next request, you check forapp.session.started in Twig. Thereis a flash message in the session, but the session hasn't been started yet, so the message is not displayed.

Is there some mechanism that would avoid this issue?

More broadly, after readingsymfony/symfony#6036, it sounds like we might need a small cookbook article on how to avoid starting the session (including the note about the flashbag and perhaps some notes about security). But we can handle that in another issue.

Thanks!

@fabpot
Copy link
MemberAuthor

I don't understand how your scenario can happen. If you set something in the session in request 1, the session is going to be started in all sub-sequent requests.

weaverryan added a commit that referenced this pull requestMay 5, 2013
fixed example to check if the session exists when getting flash messages to avoid starting sessions when not needed
@weaverryanweaverryan merged commit1501120 intosymfony:2.1May 5, 2013
@weaverryan
Copy link
Member

I've also opened#2607 as a reminder to add a bit more about this topic.

Thanks!

@TerjeBr
Copy link
Contributor

@fabpot is wrong about this. The session is not automatically started in later requests if it has been started before.

@TerjeBr
Copy link
Contributor

@fabpotfabpot deleted the session branchMarch 3, 2014 12:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@fabpot@weaverryan@TerjeBr@wouterj

[8]ページ先頭

©2009-2025 Movatter.jp