diff --git a/NEWS b/NEWS index cf376832ae405..c0828bbd75050 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,9 @@ PHP NEWS . Added extension specific Exceptions/Errors (RandomException, RandomError, BrokenRandomEngineError). (timwolla) +- Session: + . Fixed GH-9200 (setcookie has an obsolete expires date format). (timwolla) + - Standard: . Fixed bug #65489 (glob() basedir check is inconsistent). (Jakub Zelenka) . Fixed GH-9200 (setcookie has an obsolete expires date format). (Derick) diff --git a/ext/session/session.c b/ext/session/session.c index 505347186e9b8..3a807fd0d9970 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1345,7 +1345,7 @@ static zend_result php_session_send_cookie(void) /* {{{ */ t = tv.tv_sec + PS(cookie_lifetime); if (t > 0) { - date_fmt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, t, 0); + date_fmt = 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, t, 0); smart_str_appends(&ncookie, COOKIE_EXPIRES); smart_str_appendl(&ncookie, ZSTR_VAL(date_fmt), ZSTR_LEN(date_fmt)); zend_string_release_ex(date_fmt, 0); diff --git a/ext/session/tests/gh9200.phpt b/ext/session/tests/gh9200.phpt new file mode 100644 index 0000000000000..fd6e28ab8b908 --- /dev/null +++ b/ext/session/tests/gh9200.phpt @@ -0,0 +1,23 @@ +--TEST-- +GH-9200: setcookie has an obsolete expires date format +--INI-- +session.cookie_lifetime=3600 +--EXTENSIONS-- +session +--CGI-- +--FILE-- + +--EXPECT-- +Success