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

[HttpFoundation] NativeSessionStorageregenerate method wrongly sets storage as started#15799

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

Closed

Conversation

@iambrosi
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

This PR fixes an error when regenerating session IDs for non-active sessions.
Right now, the session is flagged asstarted, no matter if the session ID was successfully regenerated or not, making the storageunable tostart the session later on.

This also fixes a future error with PHP 7, which throws an error if a regeneration is attempted for non-active sessions.

session_regenerate_id(): Cannot regenerate session id - session is not active

The Session Storage should not be flagged as started if`session_regenerate_id` fails. A common use case would be to attemptregeneration before actually starting the session.
This is to avoid flagging the storage as started(done by`loadSession()`) if the regeneration fails. Also, PHP 7 will throw anerror if a regeneration is attempted for non-active sessions.
@iambrosiiambrosi changed the titleTestregenerate wrongly sets storage as startedSessionStorageregenerate wrongly sets storage as startedSep 16, 2015
@iambrosiiambrosi changed the titleSessionStorageregenerate wrongly sets storage as started[HttpFoundation] NativeSessionStorageregenerate method wrongly sets storage as startedSep 17, 2015
@iambrosi
Copy link
ContributorAuthor

Updated title to followcontribution standards.

@fabpot
Copy link
Member

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

PHP 5.4 and newer should usesession_status(). Seestart() method.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Fixed!

`session_status()` should be used in PHP >= 5.4 instead of `session_id()`.
@Tobion
Copy link
Contributor

👍

@Tobion
Copy link
Contributor

Status: Reviewed

@fabpot
Copy link
Member

Thank you@iambrosi.

@fabpotfabpot closed thisSep 28, 2015
fabpot added a commit that referenced this pull requestSep 28, 2015
…wrongly sets storage as started (iambrosi)This PR was squashed before being merged into the 2.3 branch (closes#15799).Discussion----------[HttpFoundation] NativeSessionStorage `regenerate` method wrongly sets storage as started| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |This PR fixes an error when regenerating session IDs for non-active sessions.Right now, the session is flagged as _started_, no matter if the session ID was successfully regenerated or not, making the storage [unable to _start the session_](https://github.com/symfony/symfony/blob/6393ec31690a3ecc73e5f1f7ea2185cda7aba203/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php#L130-L132) later on.This also fixes a future error with PHP 7, which throws an error if a regeneration is attempted for non-active sessions.```session_regenerate_id(): Cannot regenerate session id - session is not active```Commits-------8e6ef9c [HttpFoundation] NativeSessionStorage  method wrongly sets storage as started
This was referencedOct 27, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@iambrosi@fabpot@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp