diff --git a/ext/session/session.c b/ext/session/session.c
index df799ca57e71..db3cda305d17 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -83,13 +83,13 @@ zend_class_entry *php_session_update_timestamp_iface_entry;
#define SESSION_CHECK_ACTIVE_STATE \
if (PS(session_status) == php_session_active) { \
- php_error_docref(NULL, E_WARNING, "Session ini settings cannot be changed when a session is active"); \
+ php_session_session_already_started_error(E_WARNING, "Session ini settings cannot be changed when a session is active"); \
return FAILURE; \
}
#define SESSION_CHECK_OUTPUT_STATE \
if (SG(headers_sent) && stage != ZEND_INI_STAGE_DEACTIVATE) { \
- php_error_docref(NULL, E_WARNING, "Session ini settings cannot be changed after headers have already been sent"); \
+ php_session_headers_already_sent_error(E_WARNING, "Session ini settings cannot be changed after headers have already been sent"); \
return FAILURE; \
}
@@ -121,6 +121,29 @@ static inline void php_rinit_session_globals(void) /* {{{ */
}
/* }}} */
+static inline void php_session_headers_already_sent_error(int severity, const char *message) { /* {{{ */
+ const char *output_start_filename = php_output_get_start_filename();
+ int output_start_lineno = php_output_get_start_lineno();
+ if (output_start_filename != NULL) {
+ php_error_docref(NULL, severity, "%s (sent from %s on line %d)", message, output_start_filename, output_start_lineno);
+ } else {
+ php_error_docref(NULL, severity, "%s", message);
+ }
+}
+/* }}} */
+
+static inline void php_session_session_already_started_error(int severity, const char *message) { /* {{{ */
+ if (PS(session_started_filename) != NULL) {
+ php_error_docref(NULL, severity, "%s (started from %s on line %"PRIu32")", message, ZSTR_VAL(PS(session_started_filename)), PS(session_started_lineno));
+ } else if (PS(auto_start)) {
+ /* This option can't be changed at runtime, so we can assume it's because of this */
+ php_error_docref(NULL, severity, "%s (session started automatically)", message);
+ } else {
+ php_error_docref(NULL, severity, "%s", message);
+ }
+}
+/* }}} */
+
static inline void php_session_cleanup_filename(void) /* {{{ */
{
if (PS(session_started_filename)) {
@@ -1327,15 +1350,8 @@ static int php_session_cache_limiter(void) /* {{{ */
if (PS(session_status) != php_session_active) return -1;
if (SG(headers_sent)) {
- const char *output_start_filename = php_output_get_start_filename();
- int output_start_lineno = php_output_get_start_lineno();
-
php_session_abort();
- if (output_start_filename) {
- php_error_docref(NULL, E_WARNING, "Session cache limiter cannot be sent after headers have already been sent (output started at %s:%d)", output_start_filename, output_start_lineno);
- } else {
- php_error_docref(NULL, E_WARNING, "Session cache limiter cannot be sent after headers have already been sent");
- }
+ php_session_headers_already_sent_error(E_WARNING, "Session cache limiter cannot be sent after headers have already been sent");
return -2;
}
@@ -1404,14 +1420,7 @@ static zend_result php_session_send_cookie(void) /* {{{ */
zend_string *e_id;
if (SG(headers_sent)) {
- const char *output_start_filename = php_output_get_start_filename();
- int output_start_lineno = php_output_get_start_lineno();
-
- if (output_start_filename) {
- php_error_docref(NULL, E_WARNING, "Session cookie cannot be sent after headers have already been sent (output started at %s:%d)", output_start_filename, output_start_lineno);
- } else {
- php_error_docref(NULL, E_WARNING, "Session cookie cannot be sent after headers have already been sent");
- }
+ php_session_headers_already_sent_error(E_WARNING, "Session cookie cannot be sent after headers have already been sent");
return FAILURE;
}
@@ -1606,14 +1615,7 @@ PHPAPI zend_result php_session_start(void) /* {{{ */
switch (PS(session_status)) {
case php_session_active:
- if (PS(session_started_filename)) {
- php_error(E_NOTICE, "Ignoring session_start() because a session has already been started (started from %s on line %"PRIu32")", ZSTR_VAL(PS(session_started_filename)), PS(session_started_lineno));
- } else if (PS(auto_start)) {
- /* This option can't be changed at runtime, so we can assume it's because of this */
- php_error(E_NOTICE, "Ignoring session_start() because a session has already been started automatically");
- } else {
- php_error(E_NOTICE, "Ignoring session_start() because a session has already been started");
- }
+ php_session_session_already_started_error(E_NOTICE, "Ignoring session_start() because a session has already been started");
return FAILURE;
break;
@@ -1796,12 +1798,12 @@ PHP_FUNCTION(session_set_cookie_params)
}
if (PS(session_status) == php_session_active) {
- php_error_docref(NULL, E_WARNING, "Session cookie parameters cannot be changed when a session is active");
+ php_session_session_already_started_error(E_WARNING, "Session cookie parameters cannot be changed when a session is active");
RETURN_FALSE;
}
if (SG(headers_sent)) {
- php_error_docref(NULL, E_WARNING, "Session cookie parameters cannot be changed after headers have already been sent");
+ php_session_headers_already_sent_error(E_WARNING, "Session cookie parameters cannot be changed after headers have already been sent");
RETURN_FALSE;
}
@@ -1968,12 +1970,12 @@ PHP_FUNCTION(session_name)
}
if (name && PS(session_status) == php_session_active) {
- php_error_docref(NULL, E_WARNING, "Session name cannot be changed when a session is active");
+ php_session_session_already_started_error(E_WARNING, "Session name cannot be changed when a session is active");
RETURN_FALSE;
}
if (name && SG(headers_sent)) {
- php_error_docref(NULL, E_WARNING, "Session name cannot be changed after headers have already been sent");
+ php_session_headers_already_sent_error(E_WARNING, "Session name cannot be changed after headers have already been sent");
RETURN_FALSE;
}
@@ -1998,12 +2000,12 @@ PHP_FUNCTION(session_module_name)
}
if (name && PS(session_status) == php_session_active) {
- php_error_docref(NULL, E_WARNING, "Session save handler module cannot be changed when a session is active");
+ php_session_session_already_started_error(E_WARNING, "Session save handler module cannot be changed when a session is active");
RETURN_FALSE;
}
if (name && SG(headers_sent)) {
- php_error_docref(NULL, E_WARNING, "Session save handler module cannot be changed after headers have already been sent");
+ php_session_headers_already_sent_error(E_WARNING, "Session save handler module cannot be changed after headers have already been sent");
RETURN_FALSE;
}
@@ -2039,12 +2041,12 @@ PHP_FUNCTION(session_module_name)
static bool can_session_handler_be_changed(void) {
if (PS(session_status) == php_session_active) {
- php_error_docref(NULL, E_WARNING, "Session save handler cannot be changed when a session is active");
+ php_session_session_already_started_error(E_WARNING, "Session save handler cannot be changed when a session is active");
return false;
}
if (SG(headers_sent)) {
- php_error_docref(NULL, E_WARNING, "Session save handler cannot be changed after headers have already been sent");
+ php_session_headers_already_sent_error(E_WARNING, "Session save handler cannot be changed after headers have already been sent");
return false;
}
@@ -2279,12 +2281,12 @@ PHP_FUNCTION(session_save_path)
}
if (name && PS(session_status) == php_session_active) {
- php_error_docref(NULL, E_WARNING, "Session save path cannot be changed when a session is active");
+ php_session_session_already_started_error(E_WARNING, "Session save path cannot be changed when a session is active");
RETURN_FALSE;
}
if (name && SG(headers_sent)) {
- php_error_docref(NULL, E_WARNING, "Session save path cannot be changed after headers have already been sent");
+ php_session_headers_already_sent_error(E_WARNING, "Session save path cannot be changed after headers have already been sent");
RETURN_FALSE;
}
@@ -2308,12 +2310,12 @@ PHP_FUNCTION(session_id)
}
if (name && PS(session_status) == php_session_active) {
- php_error_docref(NULL, E_WARNING, "Session ID cannot be changed when a session is active");
+ php_session_session_already_started_error(E_WARNING, "Session ID cannot be changed when a session is active");
RETURN_FALSE;
}
if (name && PS(use_cookies) && SG(headers_sent)) {
- php_error_docref(NULL, E_WARNING, "Session ID cannot be changed after headers have already been sent");
+ php_session_headers_already_sent_error(E_WARNING, "Session ID cannot be changed after headers have already been sent");
RETURN_FALSE;
}
@@ -2350,12 +2352,12 @@ PHP_FUNCTION(session_regenerate_id)
}
if (PS(session_status) != php_session_active) {
- php_error_docref(NULL, E_WARNING, "Session ID cannot be regenerated when there is no active session");
+ php_session_session_already_started_error(E_WARNING, "Session ID cannot be regenerated when there is no active session");
RETURN_FALSE;
}
if (SG(headers_sent)) {
- php_error_docref(NULL, E_WARNING, "Session ID cannot be regenerated after headers have already been sent");
+ php_session_headers_already_sent_error(E_WARNING, "Session ID cannot be regenerated after headers have already been sent");
RETURN_FALSE;
}
@@ -2521,12 +2523,12 @@ PHP_FUNCTION(session_cache_limiter)
}
if (limiter && PS(session_status) == php_session_active) {
- php_error_docref(NULL, E_WARNING, "Session cache limiter cannot be changed when a session is active");
+ php_session_session_already_started_error(E_WARNING, "Session cache limiter cannot be changed when a session is active");
RETURN_FALSE;
}
if (limiter && SG(headers_sent)) {
- php_error_docref(NULL, E_WARNING, "Session cache limiter cannot be changed after headers have already been sent");
+ php_session_headers_already_sent_error(E_WARNING, "Session cache limiter cannot be changed after headers have already been sent");
RETURN_FALSE;
}
@@ -2551,12 +2553,12 @@ PHP_FUNCTION(session_cache_expire)
}
if (!expires_is_null && PS(session_status) == php_session_active) {
- php_error_docref(NULL, E_WARNING, "Session cache expiration cannot be changed when a session is active");
+ php_session_session_already_started_error(E_WARNING, "Session cache expiration cannot be changed when a session is active");
RETURN_LONG(PS(cache_expire));
}
if (!expires_is_null && SG(headers_sent)) {
- php_error_docref(NULL, E_WARNING, "Session cache expiration cannot be changed after headers have already been sent");
+ php_session_headers_already_sent_error(E_WARNING, "Session cache expiration cannot be changed after headers have already been sent");
RETURN_FALSE;
}
@@ -2637,14 +2639,7 @@ PHP_FUNCTION(session_start)
}
if (PS(session_status) == php_session_active) {
- if (PS(session_started_filename)) {
- php_error_docref(NULL, E_NOTICE, "Ignoring session_start() because a session is already active (started from %s on line %"PRIu32")", ZSTR_VAL(PS(session_started_filename)), PS(session_started_lineno));
- } else if (PS(auto_start)) {
- /* This option can't be changed at runtime, so we can assume it's because of this */
- php_error_docref(NULL, E_NOTICE, "Ignoring session_start() because a session is already automatically active");
- } else {
- php_error_docref(NULL, E_NOTICE, "Ignoring session_start() because a session is already active");
- }
+ php_session_session_already_started_error(E_NOTICE, "Ignoring session_start() because a session is already active");
RETURN_TRUE;
}
@@ -2654,14 +2649,7 @@ PHP_FUNCTION(session_start)
* module is unable to rewrite output.
*/
if (PS(use_cookies) && SG(headers_sent)) {
- /* It's the header sent to blame, not the session in this case */
- const char *output_start_filename = php_output_get_start_filename();
- int output_start_lineno = php_output_get_start_lineno();
- if (output_start_filename != NULL) {
- php_error_docref(NULL, E_WARNING, "Session cannot be started after headers have already been sent (sent from %s on line %d)", output_start_filename, output_start_lineno);
- } else {
- php_error_docref(NULL, E_WARNING, "Session cannot be started after headers have already been sent");
- }
+ php_session_headers_already_sent_error(E_WARNING, "Session cannot be started after headers have already been sent");
RETURN_FALSE;
}
diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt
index 04d43e635eae..7a1398cfee20 100644
--- a/ext/session/tests/014.phpt
+++ b/ext/session/tests/014.phpt
@@ -35,8 +35,8 @@ session_destroy();
--EXPECTF--
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
diff --git a/ext/session/tests/bug73100.phpt b/ext/session/tests/bug73100.phpt
index 834f2abf0f4f..21e698a14aba 100644
--- a/ext/session/tests/bug73100.phpt
+++ b/ext/session/tests/bug73100.phpt
@@ -22,7 +22,7 @@ try {
--EXPECTF--
bool(true)
-Warning: session_module_name(): Session save handler module cannot be changed when a session is active in %s on line %d
+Warning: session_module_name(): Session save handler module cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(true)
session_module_name(): Argument #1 ($module) cannot be "user"
===DONE===
diff --git a/ext/session/tests/session_cache_limiter_variation1.phpt b/ext/session/tests/session_cache_limiter_variation1.phpt
index dc095f1979c2..c6be69cf8fb1 100644
--- a/ext/session/tests/session_cache_limiter_variation1.phpt
+++ b/ext/session/tests/session_cache_limiter_variation1.phpt
@@ -30,7 +30,7 @@ string(7) "nocache"
bool(true)
string(7) "nocache"
-Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active in %s on line %d
+Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(7) "nocache"
bool(true)
diff --git a/ext/session/tests/session_cache_limiter_variation2.phpt b/ext/session/tests/session_cache_limiter_variation2.phpt
index 9ef2d4dfb5e2..28cf276d32b1 100644
--- a/ext/session/tests/session_cache_limiter_variation2.phpt
+++ b/ext/session/tests/session_cache_limiter_variation2.phpt
@@ -29,7 +29,7 @@ string(7) "nocache"
bool(true)
string(7) "nocache"
-Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active in %s on line %d
+Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(7) "nocache"
bool(true)
diff --git a/ext/session/tests/session_cache_limiter_variation3.phpt b/ext/session/tests/session_cache_limiter_variation3.phpt
index 06822fcf0201..5f53676d6699 100644
--- a/ext/session/tests/session_cache_limiter_variation3.phpt
+++ b/ext/session/tests/session_cache_limiter_variation3.phpt
@@ -28,7 +28,7 @@ string(7) "nocache"
bool(true)
string(7) "nocache"
-Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active in %s on line %d
+Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(7) "nocache"
bool(true)
diff --git a/ext/session/tests/session_id_error2.phpt b/ext/session/tests/session_id_error2.phpt
index 7b7c5b88a041..35bf34ab8172 100644
--- a/ext/session/tests/session_id_error2.phpt
+++ b/ext/session/tests/session_id_error2.phpt
@@ -31,7 +31,7 @@ string(4) "test"
string(10) "1234567890"
bool(true)
-Warning: session_id(): Session ID cannot be changed when a session is active in %s on line %d
+Warning: session_id(): Session ID cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
bool(true)
string(0) ""
diff --git a/ext/session/tests/session_ini_set.phpt b/ext/session/tests/session_ini_set.phpt
index 2fbc87902e4d..f58862c209fd 100644
--- a/ext/session/tests/session_ini_set.phpt
+++ b/ext/session/tests/session_ini_set.phpt
@@ -118,67 +118,67 @@ string(1) "4"
string(1) "1"
string(15) "session started"
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
-Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
+Warning: ini_set(): Session ini settings cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
Done
diff --git a/ext/session/tests/session_save_path_variation1.phpt b/ext/session/tests/session_save_path_variation1.phpt
index a9bb83d68d28..74940fa700ba 100644
--- a/ext/session/tests/session_save_path_variation1.phpt
+++ b/ext/session/tests/session_save_path_variation1.phpt
@@ -40,7 +40,7 @@ string(%d) "%stests"
bool(true)
string(%d) "%stests"
-Warning: session_save_path(): Session save path cannot be changed when a session is active in %s on line %d
+Warning: session_save_path(): Session save path cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(%d) "%stests"
bool(true)
diff --git a/ext/session/tests/session_set_cookie_params_basic.phpt b/ext/session/tests/session_set_cookie_params_basic.phpt
index 5eecb6ad67d6..386280d17861 100644
--- a/ext/session/tests/session_set_cookie_params_basic.phpt
+++ b/ext/session/tests/session_set_cookie_params_basic.phpt
@@ -25,7 +25,7 @@ ob_end_flush();
bool(true)
bool(true)
-Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d
+Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
bool(true)
bool(true)
diff --git a/ext/session/tests/session_set_cookie_params_variation1.phpt b/ext/session/tests/session_set_cookie_params_variation1.phpt
index 6bb121354dc7..ed0b8dc9755d 100644
--- a/ext/session/tests/session_set_cookie_params_variation1.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation1.phpt
@@ -38,7 +38,7 @@ string(4) "3600"
bool(true)
string(4) "3600"
-Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d
+Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(4) "3600"
bool(true)
diff --git a/ext/session/tests/session_set_cookie_params_variation2.phpt b/ext/session/tests/session_set_cookie_params_variation2.phpt
index 0a0031b217f3..e76d10050d0b 100644
--- a/ext/session/tests/session_set_cookie_params_variation2.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation2.phpt
@@ -36,7 +36,7 @@ string(4) "/foo"
bool(true)
string(4) "/foo"
-Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d
+Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(4) "/foo"
bool(true)
diff --git a/ext/session/tests/session_set_cookie_params_variation3.phpt b/ext/session/tests/session_set_cookie_params_variation3.phpt
index 5f4b1164ec9d..65af902ff01c 100644
--- a/ext/session/tests/session_set_cookie_params_variation3.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation3.phpt
@@ -36,7 +36,7 @@ string(4) "blah"
bool(true)
string(4) "blah"
-Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d
+Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(4) "blah"
bool(true)
diff --git a/ext/session/tests/session_set_cookie_params_variation4.phpt b/ext/session/tests/session_set_cookie_params_variation4.phpt
index f5fcbaf073d7..41eb0cb765e8 100644
--- a/ext/session/tests/session_set_cookie_params_variation4.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation4.phpt
@@ -36,7 +36,7 @@ string(1) "0"
bool(true)
string(1) "0"
-Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d
+Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(1) "0"
bool(true)
diff --git a/ext/session/tests/session_set_cookie_params_variation5.phpt b/ext/session/tests/session_set_cookie_params_variation5.phpt
index 917ba4461908..03d0d5ca4e0b 100644
--- a/ext/session/tests/session_set_cookie_params_variation5.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation5.phpt
@@ -36,7 +36,7 @@ string(1) "0"
bool(true)
string(1) "0"
-Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d
+Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(1) "0"
bool(true)
diff --git a/ext/session/tests/session_set_cookie_params_variation6.phpt b/ext/session/tests/session_set_cookie_params_variation6.phpt
index f7c729c6a97b..61243f82751e 100644
--- a/ext/session/tests/session_set_cookie_params_variation6.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation6.phpt
@@ -36,7 +36,7 @@ string(7) "nothing"
bool(true)
string(7) "nothing"
-Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d
+Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(7) "nothing"
bool(true)
diff --git a/ext/session/tests/session_start_variation9.phpt b/ext/session/tests/session_start_variation9.phpt
index 3fdcdcffbb9f..9377a236d3c2 100644
--- a/ext/session/tests/session_start_variation9.phpt
+++ b/ext/session/tests/session_start_variation9.phpt
@@ -26,7 +26,7 @@ ob_end_flush();
*** Testing session_start() : variation ***
string(%d) "%s"
-Notice: session_start(): Ignoring session_start() because a session is already automatically active in %s on line %d
+Notice: session_start(): Ignoring session_start() because a session is already active (session started automatically) in %s on line %d
bool(true)
string(%d) "%s"
bool(true)
diff --git a/ext/session/tests/user_session_module/bug80889a.phpt b/ext/session/tests/user_session_module/bug80889a.phpt
index 13a546b7dc14..b3f4e3219fb7 100644
--- a/ext/session/tests/user_session_module/bug80889a.phpt
+++ b/ext/session/tests/user_session_module/bug80889a.phpt
@@ -33,6 +33,6 @@ var_dump($initHandler, $setHandler);
--EXPECTF--
Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
-Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent in %s on line %d
+Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent (sent from %s on line %d) in %s on line %d
string(8) "whatever"
string(8) "whatever"
diff --git a/ext/session/tests/user_session_module/session_set_save_handler_variation2.phpt b/ext/session/tests/user_session_module/session_set_save_handler_variation2.phpt
index 4e250fe34b17..a14f95654422 100644
--- a/ext/session/tests/user_session_module/session_set_save_handler_variation2.phpt
+++ b/ext/session/tests/user_session_module/session_set_save_handler_variation2.phpt
@@ -30,6 +30,6 @@ bool(true)
Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
-Warning: session_set_save_handler(): Session save handler cannot be changed when a session is active in %s on line %d
+Warning: session_set_save_handler(): Session save handler cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
bool(true)
diff --git a/ext/session/tests/user_session_module/session_set_save_handler_variation3.phpt b/ext/session/tests/user_session_module/session_set_save_handler_variation3.phpt
index a5260100b9cb..78cf2bf63b8b 100644
--- a/ext/session/tests/user_session_module/session_set_save_handler_variation3.phpt
+++ b/ext/session/tests/user_session_module/session_set_save_handler_variation3.phpt
@@ -29,10 +29,10 @@ rmdir($path);
*** Testing session_set_save_handler() : variation ***
int(2)
-Warning: session_save_path(): Session save path cannot be changed when a session is active in %s on line %d
+Warning: session_save_path(): Session save path cannot be changed when a session is active (session started automatically) in %s on line %d
Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
-Warning: session_set_save_handler(): Session save handler cannot be changed when a session is active in %s on line %d
+Warning: session_set_save_handler(): Session save handler cannot be changed when a session is active (session started automatically) in %s on line %d
bool(false)
bool(true)