Index: ext/standard/head.c =================================================================== RCS file: /repository/php-src/ext/standard/head.c,v retrieving revision 1.78 diff -u -p -d -r1.78 head.c --- ext/standard/head.c 7 Jan 2005 20:55:46 -0000 1.78 +++ ext/standard/head.c 8 Jul 2005 10:57:10 -0000 @@ -20,6 +20,7 @@ #include #include "php.h" #include "ext/standard/php_standard.h" +#include "ext/date/php_date.h" #include "SAPI.h" #include "php_main.h" #include "head.h" @@ -63,8 +64,9 @@ PHPAPI int php_setcookie(char *name, int { char *cookie, *encoded_value = NULL; int len=sizeof("Set-Cookie: "); - time_t t; + time_t ts; char *dt; + timelib_time *t; sapi_header_line ctr = {0}; int result; @@ -102,17 +104,26 @@ PHPAPI int php_setcookie(char *name, int * 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 */ - t = time(NULL) - 31536001; - dt = php_std_date(t TSRMLS_CC); - sprintf(cookie, "Set-Cookie: %s=deleted; expires=%s", name, dt); + t = timelib_time_ctor(); + ts = time(NULL) - 31536001; + timelib_unixtime2gmt(t, ts); + + dt = php_format_date("D, d-M-Y H:i:s", sizeof("D, d-M-Y H:i:s")-1, t, 0); + sprintf(cookie, "Set-Cookie: %s=deleted; expires=%s GMT", name, dt); efree(dt); + timelib_time_dtor(t); } else { sprintf(cookie, "Set-Cookie: %s=%s", name, value ? encoded_value : ""); if (expires > 0) { strcat(cookie, "; expires="); - dt = php_std_date(expires TSRMLS_CC); + t = timelib_time_ctor(); + timelib_unixtime2gmt(t, expires); + + dt = php_format_date("D, d-M-Y H:i:s", sizeof("D, d-M-Y H:i:s")-1, t, 0); strcat(cookie, dt); + strcat(cookie, " GMT"); efree(dt); + timelib_time_dtor(t); } }