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