-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Update expires format for session cookie #9304
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
Conversation
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.
This looks good. I hadn't realised that this didn't go through the normal php_setcookie API. Should it?
Do see if you can add a test though.
All things being equal, it should. I might look into this as a follow-up improvement.
I had a look at creating a test, but to my understanding this is non-trivial, unless I want to create a flaky test. As I can't fixate the current time, I can't control the expiry time. Even just adding some time amount X to the current time, might cause false failures if the second rolls over. |
I think it would be sufficient to test the format, not any particular date. |
Yes, but this is also going to get ugly quickly: |
I have to admit, that this test would be harder to write than it should, but you can rely on PCRE being available; it is a required extension. |
Oh, indeed. Not sure where I looked before to get the false impression that it isn't. I'll have a look at adding the test then. |
BTW, the fact that PCRE is required is the reason for us to bundle libpcre. |
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! Looks good to me (assuming AppVeyor CI passed).
This PR was merged into the 4.4 branch. Discussion ---------- [HttpFoundation] Fix tests on PHP 8.2 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Follows php/php-src#9304 Commits ------- 1c574bb [HttpFoundation] Fix tests on PHP 8.2
Even if
DATE_FORMAT_COOKIE
is not updated, at the very least regular cookies and sessions cookies should be consistent.see GH-9200
see 15e3fcb