1--TEST--
2Test session_get_cookie_params() function : basic functionality
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php include('skipif.inc'); ?>
7--INI--
8session.cookie_lifetime=0
9session.cookie_path="/"
10session.cookie_domain=""
11session.cookie_secure=0
12session.cookie_httponly=0
13session.cookie_samesite=""
14--FILE--
15<?php
16
17ob_start();
18
19echo "*** Testing session_get_cookie_params() : basic functionality ***\n";
20
21var_dump(session_get_cookie_params());
22var_dump(session_set_cookie_params(3600, "/path", "blah", FALSE, FALSE));
23var_dump(session_get_cookie_params());
24var_dump(session_set_cookie_params(1234567890, "/guff", "foo", TRUE, TRUE));
25var_dump(session_get_cookie_params());
26var_dump(session_set_cookie_params([
27  "lifetime" => 123,
28  "path" => "/bar",
29  "domain" => "baz",
30  "secure" => FALSE,
31  "httponly" => FALSE,
32  "samesite" => "please"]));
33var_dump(session_get_cookie_params());
34
35echo "Done";
36ob_end_flush();
37?>
38--EXPECT--
39*** Testing session_get_cookie_params() : basic functionality ***
40array(6) {
41  ["lifetime"]=>
42  int(0)
43  ["path"]=>
44  string(1) "/"
45  ["domain"]=>
46  string(0) ""
47  ["secure"]=>
48  bool(false)
49  ["httponly"]=>
50  bool(false)
51  ["samesite"]=>
52  string(0) ""
53}
54bool(true)
55array(6) {
56  ["lifetime"]=>
57  int(3600)
58  ["path"]=>
59  string(5) "/path"
60  ["domain"]=>
61  string(4) "blah"
62  ["secure"]=>
63  bool(false)
64  ["httponly"]=>
65  bool(false)
66  ["samesite"]=>
67  string(0) ""
68}
69bool(true)
70array(6) {
71  ["lifetime"]=>
72  int(1234567890)
73  ["path"]=>
74  string(5) "/guff"
75  ["domain"]=>
76  string(3) "foo"
77  ["secure"]=>
78  bool(true)
79  ["httponly"]=>
80  bool(true)
81  ["samesite"]=>
82  string(0) ""
83}
84bool(true)
85array(6) {
86  ["lifetime"]=>
87  int(123)
88  ["path"]=>
89  string(4) "/bar"
90  ["domain"]=>
91  string(3) "baz"
92  ["secure"]=>
93  bool(false)
94  ["httponly"]=>
95  bool(false)
96  ["samesite"]=>
97  string(6) "please"
98}
99Done
100