-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Cookie::isCleared() with expire === 0 #27946
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
Comments
@mlocati looks like you're right. Willing to do a PR? |
I'm a few thousands miles away from my PC for a couple of weeks. But feel free to patch it yourself |
Just wondering: why should |
it is a special value symfony/src/Symfony/Component/HttpFoundation/Cookie.php Lines 138 to 140 in 0eea077
|
Thanks, bug confirmed to me also then, PR welcome :) |
This PR was merged into the 2.8 branch. Discussion ---------- [HttpFoundation] Fix Cookie::isCleared | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #27946 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- d3d7766 [HttpFoundation] Fix Cookie::isCleared
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 4.1.1
Description
The
expire
field of a Cookie object (accessible withgetExpiresTime()
) is used when callingsetrawcookie
.From the PHP manual, if
expire
is0
, the cookie will expire at the end of the session (when the browser closes).So, a cookie with
expire
set to0
is valid. BTWisCleared
returnstrue
in this case.How to reproduce
it should be
false
in both cases, but it istrue
.Possible Solution
Patch the
isCleared
method, changing fromto
The text was updated successfully, but these errors were encountered: