-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add auto_regenerate option to CacheSessionPersistence #51
Conversation
Can you please add tests to cover behaviour when As this is similar to #44 but without the BC problems, I'll defer to @weierophinney for review. Fixing the psalm issues in the factory will require verifying that |
Signed-off-by: Michal Izewski <[email protected]>
Signed-off-by: Michal Izewski <[email protected]>
Signed-off-by: Michal Izewski <[email protected]>
Thanks for the comment, I've updated both unit tests and the psalm baseline to cover the auto_regenerate option |
Signed-off-by: Michal Izewski <[email protected]>
Signed-off-by: Michal Izewski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @michal-izewski - This looks good to me with a couple of minor tweaks 👍
Co-authored-by: George Steel <[email protected]> Signed-off-by: Michał Iżewski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor tweak suggested, to give a little more type certainty in the factory. Otherwise, this looks good! I'm happy with an opt-in solution for this; the regeneration was done for a defense-in-depth approach, but obviously there are cases where this is not desired. Leaving the default as regeneration will work well for this.
@@ -46,7 +47,8 @@ public function __invoke(ContainerInterface $container) | |||
$cookieDomain, | |||
$cookieSecure, | |||
$cookieHttpOnly, | |||
$cookieSameSite | |||
$cookieSameSite, | |||
$autoRegenerate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd cast this to boolean here (and do the same for $cookieSameSite
while you're at it):
(bool) $cookieSameSite,
(bool) $autoRegenerate,
This will remove one more baseline item, and prevent some common errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've introduced type casting for all boolean arguments (as suggested) - $cookieSameSite is expected to be a string so I left it as is for now
Signed-off-by: Michal Izewski <[email protected]>
Description
Allow to turn off automatic session ID regeneration on each session data change.