1--TEST--
2Test session_get_cookie_params() function : variation
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--INI--
6session.cookie_lifetime=0
7session.cookie_path="/"
8session.cookie_domain=""
9session.cookie_secure=0
10session.cookie_httponly=0
11session.cookie_samesite=""
12--FILE--
13<?php
14
15ob_start();
16
17echo "*** Testing session_get_cookie_params() : variation ***\n";
18
19var_dump(session_get_cookie_params());
20ini_set("session.cookie_lifetime", 3600);
21var_dump(session_get_cookie_params());
22ini_set("session.cookie_path", "/path");
23var_dump(session_get_cookie_params());
24ini_set("session.cookie_domain", "foo");
25var_dump(session_get_cookie_params());
26ini_set("session.cookie_secure", TRUE);
27var_dump(session_get_cookie_params());
28ini_set("session.cookie_httponly", TRUE);
29var_dump(session_get_cookie_params());
30ini_set("session.cookie_samesite", "foo");
31var_dump(session_get_cookie_params());
32
33echo "Done";
34ob_end_flush();
35?>
36--EXPECT--
37*** Testing session_get_cookie_params() : variation ***
38array(6) {
39  ["lifetime"]=>
40  int(0)
41  ["path"]=>
42  string(1) "/"
43  ["domain"]=>
44  string(0) ""
45  ["secure"]=>
46  bool(false)
47  ["httponly"]=>
48  bool(false)
49  ["samesite"]=>
50  string(0) ""
51}
52array(6) {
53  ["lifetime"]=>
54  int(3600)
55  ["path"]=>
56  string(1) "/"
57  ["domain"]=>
58  string(0) ""
59  ["secure"]=>
60  bool(false)
61  ["httponly"]=>
62  bool(false)
63  ["samesite"]=>
64  string(0) ""
65}
66array(6) {
67  ["lifetime"]=>
68  int(3600)
69  ["path"]=>
70  string(5) "/path"
71  ["domain"]=>
72  string(0) ""
73  ["secure"]=>
74  bool(false)
75  ["httponly"]=>
76  bool(false)
77  ["samesite"]=>
78  string(0) ""
79}
80array(6) {
81  ["lifetime"]=>
82  int(3600)
83  ["path"]=>
84  string(5) "/path"
85  ["domain"]=>
86  string(3) "foo"
87  ["secure"]=>
88  bool(false)
89  ["httponly"]=>
90  bool(false)
91  ["samesite"]=>
92  string(0) ""
93}
94array(6) {
95  ["lifetime"]=>
96  int(3600)
97  ["path"]=>
98  string(5) "/path"
99  ["domain"]=>
100  string(3) "foo"
101  ["secure"]=>
102  bool(true)
103  ["httponly"]=>
104  bool(false)
105  ["samesite"]=>
106  string(0) ""
107}
108array(6) {
109  ["lifetime"]=>
110  int(3600)
111  ["path"]=>
112  string(5) "/path"
113  ["domain"]=>
114  string(3) "foo"
115  ["secure"]=>
116  bool(true)
117  ["httponly"]=>
118  bool(true)
119  ["samesite"]=>
120  string(0) ""
121}
122array(6) {
123  ["lifetime"]=>
124  int(3600)
125  ["path"]=>
126  string(5) "/path"
127  ["domain"]=>
128  string(3) "foo"
129  ["secure"]=>
130  bool(true)
131  ["httponly"]=>
132  bool(true)
133  ["samesite"]=>
134  string(3) "foo"
135}
136Done
137