1--TEST--
2Test session_get_cookie_params() function : basic functionality
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() : basic functionality ***\n";
18
19var_dump(session_get_cookie_params());
20var_dump(session_set_cookie_params(3600, "/path", "blah", FALSE, FALSE));
21var_dump(session_get_cookie_params());
22var_dump(session_set_cookie_params(1234567890, "/guff", "foo", TRUE, TRUE));
23var_dump(session_get_cookie_params());
24var_dump(session_set_cookie_params([
25  "lifetime" => 123,
26  "path" => "/bar",
27  "domain" => "baz",
28  "secure" => FALSE,
29  "httponly" => FALSE,
30  "samesite" => "please"]));
31var_dump(session_get_cookie_params());
32
33echo "Done";
34ob_end_flush();
35?>
36--EXPECT--
37*** Testing session_get_cookie_params() : basic functionality ***
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}
52bool(true)
53array(6) {
54  ["lifetime"]=>
55  int(3600)
56  ["path"]=>
57  string(5) "/path"
58  ["domain"]=>
59  string(4) "blah"
60  ["secure"]=>
61  bool(false)
62  ["httponly"]=>
63  bool(false)
64  ["samesite"]=>
65  string(0) ""
66}
67bool(true)
68array(6) {
69  ["lifetime"]=>
70  int(1234567890)
71  ["path"]=>
72  string(5) "/guff"
73  ["domain"]=>
74  string(3) "foo"
75  ["secure"]=>
76  bool(true)
77  ["httponly"]=>
78  bool(true)
79  ["samesite"]=>
80  string(0) ""
81}
82bool(true)
83array(6) {
84  ["lifetime"]=>
85  int(123)
86  ["path"]=>
87  string(4) "/bar"
88  ["domain"]=>
89  string(3) "baz"
90  ["secure"]=>
91  bool(false)
92  ["httponly"]=>
93  bool(false)
94  ["samesite"]=>
95  string(6) "please"
96}
97Done
98