Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #35732 [FrameworkBundle][HttpKernel] Add session usage report…
…ing in stateless mode (mtarld) This PR was merged into the 5.1-dev branch. Discussion ---------- [FrameworkBundle][HttpKernel] Add session usage reporting in stateless mode | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | License | MIT | Doc PR | TODO https://github.com/orgs/symfony/projects/1#card-30506005 Provide a `@Stateless` annotation that forbid session usage for annotated controllers (or classes). ## Implementations **v1** - ~~New session proxy that allows session to be marked as disabled~~ - ~~New default route attribute: `_stateless` (automatically set by `@Stateless`)~~ - ~~On kernel controller event, if `_stateless` is `true`, session is marked as disabled~~ - ~~Session listener is able to check if the session is disabled and prevent its creation~~ **v2** - New default route attribute: `_stateless` (automatically set by `@Stateless`) - On kernel response, check the session usage and if session was used when `_stateless` attribute is set to `true`: Either throw an exception (debug enabled) or log a warning (debug disabled) Commits ------- bc48db2 [FrameworkBundle][HttpFoundation] Add `_stateless`
- Loading branch information
Showing
7 changed files
with
120 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/Symfony/Component/HttpKernel/Exception/UnexpectedSessionUsageException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\HttpKernel\Exception; | ||
|
||
/** | ||
* @author Mathias Arlaud <mathias.arlaud@gmail.com> | ||
*/ | ||
class UnexpectedSessionUsageException extends \LogicException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters