php/php-src — pull request #238 by narfbg (2012-12-05 12:09:53+00:00)
Title: Issue 23955: setcookie() to send Max-Age attribute

`setcookie()` should send not only the *Expires*, but also the *Max-Age* attribute.
Changed the session extension to send the Max-Age attribute as well.

As described in [#23955](https://bugs.php.net/bug.php?id=23955), a user agent having an erroneously configured timezone would have issues when calculating when to expire the cookie.

As described in [RFC6265](http://www.faqs.org/rfcs/rfc6265.html), Max-Age must be implemented by user agents in the following manner:

* Specifies delta time in seconds and when present.
* Has precedence over Expires, when both are present.
* Can't have a negative value.
* User agents that don't support it should simply ignore it.

Given those characteristics, it only makes sense that both Expires and Max-Age are sent together.

This MIGHT also fix [#43439](https://bugs.php.net/bug.php?id=43439), but I'm not really sure about it - should be checked.