Skip to content

Commit 3b6d83a

Browse files
authored
ext/standard: set[raw]cookie: No format call needed for constant expires (php#19900)
1 parent cb49281 commit 3b6d83a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/standard/head.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,9 @@ PHPAPI zend_result php_setcookie(zend_string *name, zend_string *value, time_t e
131131
* so in order to force cookies to be deleted, even on MSIE, we
132132
* pick an expiry date in the past
133133
*/
134-
dt = php_format_date("D, d M Y H:i:s \\G\\M\\T", sizeof("D, d M Y H:i:s \\G\\M\\T")-1, 1, 0);
135134
smart_str_appends(&buf, "Set-Cookie: ");
136135
smart_str_append(&buf, name);
137-
smart_str_appends(&buf, "=deleted; expires=");
138-
smart_str_append(&buf, dt);
139-
smart_str_appends(&buf, "; Max-Age=0");
140-
zend_string_free(dt);
136+
smart_str_appends(&buf, "=deleted; expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=0");
141137
} else {
142138
smart_str_appends(&buf, "Set-Cookie: ");
143139
smart_str_append(&buf, name);

0 commit comments

Comments
 (0)