[Bug] 72071 - Prevent Max-Age from being negative#2452
[Bug] 72071 - Prevent Max-Age from being negative#2452duncan3dc wants to merge 2 commits intophp:masterfrom
Conversation
| int diff; | ||
| diff = difftime(expires, time(NULL)); | ||
| if (diff < 0) { | ||
| diff = 0; |
There was a problem hiding this comment.
maybe emit a warning/notice?
There was a problem hiding this comment.
It's not a warning type event though is it? An expires at date in the past is valid, it's just that "max-age" shouldn't be negative
There was a problem hiding this comment.
hm you are right... the docs state that a value in the past should be used when the cookies needs to be deleted. therefore a warning/notice doesnt fit in here.
leave it as is ;)
There was a problem hiding this comment.
Is it a problem that this makes the expires and Max-Age inconsistent?
There was a problem hiding this comment.
I guess it doesn't matter, as https://github.com/php/php-src/pull/2452/files#diff-21dee5b8091e1e7a0be91db21ad89053R129 also does it.
|
Merged as ba6561d, thanks! |
As reported in the below bug report:
https://bugs.php.net/bug.php?id=72071