Skip to content

[HttpFoundation] Compute cookie max-age attribute #20644

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

Merged
merged 1 commit into from
Dec 15, 2016
Merged

[HttpFoundation] Compute cookie max-age attribute #20644

merged 1 commit into from
Dec 15, 2016

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Nov 26, 2016

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets comma-separated list of tickets fixed by the PR, if any
License MIT
Doc PR reference to the documentation PR, if any

See https://wiki.php.net/rfc/cookie_max-age, PHP sends it since 5.5.

The date format actually differs now from PHP (Saturday instead of Sat). But it really doesnt matter much imo, using the constant seems more reliable to me and max-age overrules anyway ;)

Relates to #20569

@fabpot
Copy link
Member

fabpot commented Dec 13, 2016

This one breaks tests and should be done in master as this is a new feature.

@ro0NL
Copy link
Contributor Author

ro0NL commented Dec 13, 2016

Agree on master. I improved some affected tests already in #20569, preferably that goes first :)

@fabpot
Copy link
Member

fabpot commented Dec 13, 2016

I think they are not really related and this one can probably be merged much faster than the other one :)

@ro0NL
Copy link
Contributor Author

ro0NL commented Dec 13, 2016

Fair enough :) it's not the effort anyways.. ill update tests this evening 👍

@ro0NL ro0NL changed the base branch from 3.1 to master December 13, 2016 19:28
@@ -72,9 +72,13 @@ public function testGetPath()

public function testGetExpiresTime()
{
$cookie = new Cookie('foo', 'bar', 3600);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated tests that are passing 3600 as expire time as well. 3600 implies max-age value, not a expire time. This was rather confusing :)

@ro0NL
Copy link
Contributor Author

ro0NL commented Dec 13, 2016

Ready. Failing test (PHP7/redis) seems unrelated.

edit; apparently HHVM differs on the DATE_COOKIE constant 😠 (ref) put back the original format hardcoded?

@ro0NL
Copy link
Contributor Author

ro0NL commented Dec 14, 2016

Truly ready 👍 (also no conflict with #20910)

@fabpot
Copy link
Member

fabpot commented Dec 15, 2016

Thank you @ro0NL.

@fabpot fabpot merged commit 8c28317 into symfony:master Dec 15, 2016
fabpot added a commit that referenced this pull request Dec 15, 2016
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpFoundation] Compute cookie max-age attribute

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

See https://wiki.php.net/rfc/cookie_max-age, PHP sends it since 5.5.

~~The date format actually differs now from PHP (`Saturday` instead of `Sat`). But it really doesnt matter much imo, using the constant seems more reliable to me and max-age overrules anyway ;)~~

Relates to #20569

Commits
-------

8c28317 [HttpFoundation] Compute cookie max-age attribute
@ro0NL ro0NL deleted the http-foundation/cookie-max-age branch December 15, 2016 07:42
@nicolas-grekas nicolas-grekas modified the milestones: 3.x, 3.3 Mar 24, 2017
@fabpot fabpot mentioned this pull request May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants