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
11--FILE--
12<?php
13
14ob_start();
15
16/*
17 * Prototype : array session_get_cookie_params(void)
18 * Description : Get the session cookie parameters
19 * Source code : ext/session/session.c
20 */
21
22echo "*** Testing session_get_cookie_params() : variation ***\n";
23
24var_dump(session_get_cookie_params());
25ini_set("session.cookie_lifetime", 3600);
26var_dump(session_get_cookie_params());
27ini_set("session.cookie_path", "/path");
28var_dump(session_get_cookie_params());
29ini_set("session.cookie_domain", "foo");
30var_dump(session_get_cookie_params());
31ini_set("session.cookie_secure", TRUE);
32var_dump(session_get_cookie_params());
33ini_set("session.cookie_httponly", TRUE);
34var_dump(session_get_cookie_params());
35
36echo "Done";
37ob_end_flush();
38?>
39--EXPECTF--
40*** Testing session_get_cookie_params() : variation ***
41array(5) {
42  ["lifetime"]=>
43  int(0)
44  ["path"]=>
45  string(1) "/"
46  ["domain"]=>
47  string(0) ""
48  ["secure"]=>
49  bool(false)
50  ["httponly"]=>
51  bool(false)
52}
53array(5) {
54  ["lifetime"]=>
55  int(3600)
56  ["path"]=>
57  string(1) "/"
58  ["domain"]=>
59  string(0) ""
60  ["secure"]=>
61  bool(false)
62  ["httponly"]=>
63  bool(false)
64}
65array(5) {
66  ["lifetime"]=>
67  int(3600)
68  ["path"]=>
69  string(5) "/path"
70  ["domain"]=>
71  string(0) ""
72  ["secure"]=>
73  bool(false)
74  ["httponly"]=>
75  bool(false)
76}
77array(5) {
78  ["lifetime"]=>
79  int(3600)
80  ["path"]=>
81  string(5) "/path"
82  ["domain"]=>
83  string(3) "foo"
84  ["secure"]=>
85  bool(false)
86  ["httponly"]=>
87  bool(false)
88}
89array(5) {
90  ["lifetime"]=>
91  int(3600)
92  ["path"]=>
93  string(5) "/path"
94  ["domain"]=>
95  string(3) "foo"
96  ["secure"]=>
97  bool(true)
98  ["httponly"]=>
99  bool(false)
100}
101array(5) {
102  ["lifetime"]=>
103  int(3600)
104  ["path"]=>
105  string(5) "/path"
106  ["domain"]=>
107  string(3) "foo"
108  ["secure"]=>
109  bool(true)
110  ["httponly"]=>
111  bool(true)
112}
113Done
114
115