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] Allow reuse of Session between requests if ID did not change#28433

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:2.8fromtgalopin:patch-2
Sep 21, 2018

Conversation

@tgalopin
Copy link
Contributor

@tgalopintgalopin commentedSep 10, 2018
edited
Loading

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#13450
LicenseMIT
Doc PR-

I stumbled upon the issue from#13450 in a more simple case than what was exposed in the issue. From my understanding, the problem arises when the session is used between an access to the session and a functional test request: because the session was accessed (usually using the container directly), the session has started and the following request fails.

This PR checks whether the ID was actually regenerated before throwing (if a setId is called with the same ID, it is the same request context, it shouldn't throw IMO).

Not sure I understood everything correctly though, feel free to fix it for me if needed.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

Would you mind adding a test case please?
Otherwise, lgtm thanks.

$this->storage->setId($id);
}catch (\Exception$e) {
$exception =$e;
}
Copy link
Member

Choose a reason for hiding this comment

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

$e = null;try {    $this->storage->setId($id);} catch (\Exception $e) {}$this->assertNull($e);

same below

$this->assertNotEquals('',$this->storage->getId());
}

publicfunctiontestSetId()
Copy link
Member

Choose a reason for hiding this comment

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

testSetIdAfterStart()?


$this->assertNull($exception);

$exception =null;
Copy link
Member

Choose a reason for hiding this comment

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

no need to reassign

@chalasrchalasr added this to the2.8 milestoneSep 11, 2018
@nicolas-grekasnicolas-grekas changed the titleAllow reuse of MockArraySessionStorage between requests[HttpFoundation] Allow reuse of MockArraySessionStorage between requestsSep 17, 2018
@tgalopintgalopin changed the title[HttpFoundation] Allow reuse of MockArraySessionStorage between requests[HttpFoundation] Allow reuse of Session between requests if ID did not changeSep 20, 2018
@nicolas-grekas
Copy link
Member

Thank you@tgalopin.

@nicolas-grekasnicolas-grekas merged commitfd30f4a intosymfony:2.8Sep 21, 2018
nicolas-grekas added a commit that referenced this pull requestSep 21, 2018
…f ID did not change (tgalopin)This PR was merged into the 2.8 branch.Discussion----------[HttpFoundation] Allow reuse of Session between requests if ID did not change| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#13450| License       | MIT| Doc PR        | -I stumbled upon the issue from#13450 in a more simple case than what was exposed in the issue. From my understanding, the problem arises when the session is used between an access to the session and a functional test request: because the session was accessed (usually using the container directly), the session has started and the following request fails.This PR checks whether the ID was actually regenerated before throwing (if a setId is called with the same ID, it is the same request context, it shouldn't throw IMO).Not sure I understood everything correctly though, feel free to fix it for me if needed.Commits-------fd30f4a Allow reuse of Session between requests
@tgalopintgalopin deleted the patch-2 branchSeptember 21, 2018 11:42
This was referencedSep 30, 2018
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

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

4 participants

@tgalopin@nicolas-grekas@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp