From 688e56d0ac6446dcdac2621c26586eb2de92f9b0 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 22 Mar 2021 13:21:07 +0100 Subject: [PATCH] Properly initialize PS(mod) on RINIT We need to do that in case a user handler has been set. However, we can't do that in `php_rinit_session_globals()` since that function is called by PHP function `session_destroy()` too, but in that case we don't want to reset PS(mod). Closes GH-6795. --- ext/session/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/session/session.c b/ext/session/session.c index ea9a1eede9..8fb6dd2cd5 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -2855,7 +2855,8 @@ static int php_rinit_session(zend_bool auto_start) /* {{{ */ { php_rinit_session_globals(); - if (PS(mod) == NULL) { + PS(mod) = NULL; + { char *value; value = zend_ini_string("session.save_handler", sizeof("session.save_handler") - 1, 0); -- 2.50.1