1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/standard: set[raw]cookie: No format call needed for constant expires (#19900)

This commit is contained in:
Marc Bennewitz
2025-09-21 13:25:24 +02:00
committed by GitHub
parent cb49281739
commit 3b6d83aa9c

View File

@@ -131,13 +131,9 @@ PHPAPI zend_result php_setcookie(zend_string *name, zend_string *value, time_t e
* so in order to force cookies to be deleted, even on MSIE, we
* pick an expiry date in the past
*/
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);
smart_str_appends(&buf, "Set-Cookie: ");
smart_str_append(&buf, name);
smart_str_appends(&buf, "=deleted; expires=");
smart_str_append(&buf, dt);
smart_str_appends(&buf, "; Max-Age=0");
zend_string_free(dt);
smart_str_appends(&buf, "=deleted; expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=0");
} else {
smart_str_appends(&buf, "Set-Cookie: ");
smart_str_append(&buf, name);