From 068bf645e1c9952008e08570dad27bb03101e689 Mon Sep 17 00:00:00 2001 From: Martin Jansen Date: Sun, 18 May 2014 10:45:31 +0200 Subject: [PATCH] Remove usage of pointless COOKIE_SET_COOKIE constant. --- ext/session/session.c | 2 +- ext/standard/head.c | 4 ++-- ext/standard/head.h | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ext/session/session.c b/ext/session/session.c index c5d710096d..62ebaf28a1 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1355,7 +1355,7 @@ static void php_session_send_cookie(TSRMLS_D) /* {{{ */ e_session_name = php_url_encode(PS(session_name), strlen(PS(session_name)), NULL); e_id = php_url_encode(PS(id), strlen(PS(id)), NULL); - smart_str_appends(&ncookie, COOKIE_SET_COOKIE); + smart_str_appends(&ncookie, "Set-Cookie: "); smart_str_appends(&ncookie, e_session_name); smart_str_appendc(&ncookie, '='); smart_str_appends(&ncookie, e_id); diff --git a/ext/standard/head.c b/ext/standard/head.c index 6ede184df2..0316903bc6 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -117,10 +117,10 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t * pick an expiry date in the past */ 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, "%s%s=deleted; expires=%s; Max-Age=0", COOKIE_SET_COOKIE, name, dt); + snprintf(cookie, len + 100, "Set-Cookie: %s=deleted; expires=%s; Max-Age=0", name, dt); efree(dt); } else { - snprintf(cookie, len + 100, "%s%s=%s", COOKIE_SET_COOKIE, name, value ? encoded_value : ""); + snprintf(cookie, len + 100, "Set-Cookie: %s=%s", name, value ? encoded_value : ""); if (expires > 0) { const char *p; char tsdelta[13]; diff --git a/ext/standard/head.h b/ext/standard/head.h index cb9a7f4823..59b1518676 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -21,7 +21,6 @@ #ifndef HEAD_H #define HEAD_H -#define COOKIE_SET_COOKIE "Set-Cookie: " #define COOKIE_EXPIRES "; expires=" #define COOKIE_MAX_AGE "; Max-Age=" #define COOKIE_DOMAIN "; domain=" -- 2.40.0