1--TEST-- 2Test session_set_cookie_params() function : variation 3--INI-- 4session.cookie_samesite=test 5--SKIPIF-- 6<?php include('skipif.inc'); ?> 7--FILE-- 8<?php 9 10ob_start(); 11 12echo "*** Testing session_set_cookie_params() : variation ***\n"; 13 14var_dump(ini_get("session.cookie_samesite")); 15var_dump(session_set_cookie_params(["samesite" => "nothing"])); 16var_dump(ini_get("session.cookie_samesite")); 17var_dump(session_start()); 18var_dump(ini_get("session.cookie_samesite")); 19var_dump(session_set_cookie_params(["samesite" => "test"])); 20var_dump(ini_get("session.cookie_samesite")); 21var_dump(session_destroy()); 22var_dump(ini_get("session.cookie_samesite")); 23var_dump(session_set_cookie_params(["samesite" => "other"])); 24var_dump(ini_get("session.cookie_samesite")); 25 26echo "Done"; 27ob_end_flush(); 28?> 29--EXPECTF-- 30*** Testing session_set_cookie_params() : variation *** 31string(4) "test" 32bool(true) 33string(7) "nothing" 34bool(true) 35string(7) "nothing" 36 37Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d 38bool(false) 39string(7) "nothing" 40bool(true) 41string(7) "nothing" 42bool(true) 43string(5) "other" 44Done 45