Skip to content

[HttpFoundation] NativeSessionStorage regenerate #8969

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
wants to merge 2 commits into from

Conversation

lancergr
Copy link
Contributor

@lancergr lancergr commented Sep 9, 2013

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #8460
License MIT
Doc PR

Since session_start is called by the regenerate function, then the 'started' flag of NativeSessionStorage have to be set to true. Otherwise, the variable $_SESSION is initiated and the exception "Failed to start the session: already started by PHP ($_SESSION is set)." is thrown.

This can be reproduced by clearing the session data (cookies) before authenticating with a method that does not require csrf (eg. using the confirmation link of FOSUserBundle).

@stof
Copy link
Member

stof commented Sep 9, 2013

shouldn't this be done only when the workaround is applied ?

@lancergr
Copy link
Contributor Author

do you mean we should call the loadSession inside the

if ('files' === $this->getSaveHandler()->getSaveHandlerName())
block?

@ghost
Copy link

ghost commented Sep 12, 2013

Yeah, maybe try putting it at line 221.

| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#8640
| License       | MIT
| Doc PR        |
fabpot added a commit that referenced this pull request Sep 13, 2013
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8969).

Discussion
----------

[HttpFoundation] NativeSessionStorage regenerate

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

Since session_start is called by the regenerate function, then the 'started' flag of NativeSessionStorage have to be set to true. Otherwise, the variable $_SESSION is initiated and the exception "Failed to start the session: already started by PHP ($_SESSION is set)." is thrown.

This can be reproduced by clearing the session data (cookies) before authenticating with a method that does not require csrf (eg. using the confirmation link of FOSUserBundle).

Commits
-------

7a0eeb3 [HttpFoundation] NativeSessionStorage regenerate
@fabpot fabpot closed this Sep 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants