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