scottmac Tue, 10 May 2011 19:09:24 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=310925
Log:
Turns out that more than 1% of users clocks are more than a year out of date,
this causes cookies to never get deleted since the date is in the future.
I can only guess its due to batteries on the motherboard being dead.
Changed paths:
U php/php-src/branches/PHP_5_3/ext/standard/head.c
U php/php-src/trunk/ext/standard/head.c
Modified: php/php-src/branches/PHP_5_3/ext/standard/head.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/head.c 2011-05-10 15:20:03 UTC
(rev 310924)
+++ php/php-src/branches/PHP_5_3/ext/standard/head.c 2011-05-10 19:09:24 UTC
(rev 310925)
@@ -115,10 +115,9 @@
/*
* MSIE doesn't delete a cookie when you set it to a null value
* so in order to force cookies to be deleted, even on MSIE, we
- * pick an expiry date 1 year and 1 second in the past
+ * pick an expiry date in the past
*/
- time_t t = time(NULL) - 31536001;
- dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s
T")-1, t, 0 TSRMLS_CC);
+ dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s
T")-1, 1, 0 TSRMLS_CC);
snprintf(cookie, len + 100, "Set-Cookie: %s=deleted;
expires=%s", name, dt);
efree(dt);
} else {
Modified: php/php-src/trunk/ext/standard/head.c
===================================================================
--- php/php-src/trunk/ext/standard/head.c 2011-05-10 15:20:03 UTC (rev
310924)
+++ php/php-src/trunk/ext/standard/head.c 2011-05-10 19:09:24 UTC (rev
310925)
@@ -114,10 +114,9 @@
/*
* MSIE doesn't delete a cookie when you set it to a null value
* so in order to force cookies to be deleted, even on MSIE, we
- * pick an expiry date 1 year and 1 second in the past
+ * pick an expiry date in the past
*/
- time_t t = time(NULL) - 31536001;
- dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s
T")-1, t, 0 TSRMLS_CC);
+ dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s
T")-1, 1, 0 TSRMLS_CC);
snprintf(cookie, len + 100, "Set-Cookie: %s=deleted;
expires=%s", name, dt);
efree(dt);
} else {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php