This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/HttpFoundation
Nicolas Grekas 5d30df78e7 bug #28433 [HttpFoundation] Allow reuse of Session between requests if 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 https://github.com/symfony/symfony/issues/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
-------

fd30f4a21d Allow reuse of Session between requests
2018-09-21 13:42:18 +02:00
..
Exception [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For 2016-06-29 09:01:55 +02:00
File Enable native_constant_invocation CS fixer 2018-07-26 13:13:39 +02:00
Session Allow reuse of Session between requests 2018-09-21 13:38:21 +02:00
Tests Allow reuse of Session between requests 2018-09-21 13:38:21 +02:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
AcceptHeader.php [DI] minor docblock fixes 2017-10-24 13:40:19 +02:00
AcceptHeaderItem.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
ApacheRequest.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
BinaryFileResponse.php Instantiate $offset and $maxlen at definition 2018-08-27 09:50:38 -04:00
CHANGELOG.md [HttpFoundation] Remove support for legacy and risky HTTP headers 2018-07-31 23:38:46 +02:00
composer.json Merge branch '2.7' into 2.8 2016-03-07 15:04:32 +01:00
Cookie.php [HttpFoundation] Fix Cookie::isCleared 2018-07-23 20:57:35 +02:00
ExpressionRequestMatcher.php [HttpFoundation] added ExpressionRequestMatcher 2013-09-19 12:59:11 +02:00
FileBag.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
HeaderBag.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
IpUtils.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
JsonResponse.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
LICENSE fixed years in copyright 2018-01-03 08:23:28 +01:00
ParameterBag.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
phpunit.xml.dist fail when detecting risky tests 2017-04-12 09:39:27 +02:00
README.md Updated all the README files 2016-03-04 08:12:06 +01:00
RedirectResponse.php fix the phpdoc that is not really inherited from response 2017-10-24 20:42:41 +02:00
Request.php [HttpKernel] fix forwarding trusted headers as server parameters 2018-08-22 17:45:23 +02:00
RequestMatcher.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
RequestMatcherInterface.php [DI] minor docblock fixes 2017-10-24 13:40:19 +02:00
RequestStack.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
Response.php Remove the Expires header when calling Response::expire() 2018-07-27 17:20:18 +02:00
ResponseHeaderBag.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
ServerBag.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
StreamedResponse.php [HttpFoundation] don't override StreamedResponse::setNotModified() 2018-09-16 21:50:20 +02:00

HttpFoundation Component

The HttpFoundation component defines an object-oriented layer for the HTTP specification.

Resources