1--TEST--
2Test ini_set() for session : basic functionality
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php include('skipif.inc'); ?>
7--INI--
8session.save_path=
9session.name="PHPSESSID"
10session.save_handler="files"
11session.auto_start="0"
12session.gc_probability="1"
13session.gc_divisor="100"
14session.gc_maxlifetime="1440"
15session.serialize_handler="php"
16session.cookie_path="/"
17session.cookie_domain=""
18session.cookie_secure="0"
19session.cookie_httponly="0"
20session.use_cookies="1"
21session.use_only_cookies="1"
22session.use_strict_mode="0"
23session.referer_check=""
24session.cache_limiter="nocache"
25session.cache_expire="180"
26session.use_trans_sid="0"
27session.sid_length="32"
28session.sid_bits_per_character="4"
29session.lazy_write="1"
30--FILE--
31<?php
32ob_start();
33
34/*
35 * Prototype : string ini_set(string $name, string $value)
36 * Description : Set session ini
37 * Source code : ext/session/session.c
38 */
39
40echo "*** Testing ini_set() for session ini: basic functionality ***\n";
41
42var_dump(ini_set("session.save_path", ""));
43var_dump(ini_set("session.name", "PHPSESSID"));
44var_dump(ini_set("session.save_handler", "files"));
45var_dump(ini_set("session.auto_start", "0"));
46var_dump(ini_set("session.gc_probability", "1"));
47var_dump(ini_set("session.gc_divisor", "100"));
48var_dump(ini_set("session.gc_maxlifetime", "1440"));
49var_dump(ini_set("session.serialize_handler", "php"));
50var_dump(ini_set("session.cookie_path", "/"));
51var_dump(ini_set("session.cookie_domain", ""));
52var_dump(ini_set("session.cookie_secure", "0"));
53var_dump(ini_set("session.cookie_httponly", "0"));
54var_dump(ini_set("session.use_cookies", "1"));
55var_dump(ini_set("session.use_only_cookies", "1"));
56var_dump(ini_set("session.use_strict_mode", "0"));
57var_dump(ini_set("session.referer_check", ""));
58var_dump(ini_set("session.cache_limiter", "nocache"));
59var_dump(ini_set("session.cache_expire", "180"));
60var_dump(ini_set("session.use_trans_sid", "0"));
61var_dump(ini_set("session.sid_length", "32"));
62var_dump(ini_set("session.sid_bits_per_character", "4"));
63var_dump(ini_set("session.lazy_write", "1"));
64
65session_start();
66var_dump("session started");
67
68var_dump(ini_set("session.save_path", ""));
69var_dump(ini_set("session.name", "PHPSESSID"));
70var_dump(ini_set("session.save_handler", "files"));
71var_dump(ini_set("session.auto_start", "0"));
72var_dump(ini_set("session.gc_probability", "1"));
73var_dump(ini_set("session.gc_divisor", "100"));
74var_dump(ini_set("session.gc_maxlifetime", "1440"));
75var_dump(ini_set("session.serialize_handler", "php"));
76var_dump(ini_set("session.cookie_path", "/"));
77var_dump(ini_set("session.cookie_domain", ""));
78var_dump(ini_set("session.cookie_secure", "0"));
79var_dump(ini_set("session.cookie_httponly", "0"));
80var_dump(ini_set("session.use_cookies", "1"));
81var_dump(ini_set("session.use_only_cookies", "1"));
82var_dump(ini_set("session.use_strict_mode", "0"));
83var_dump(ini_set("session.referer_check", ""));
84var_dump(ini_set("session.cache_limiter", "nocache"));
85var_dump(ini_set("session.cache_expire", "180"));
86var_dump(ini_set("session.use_trans_sid", "0"));
87var_dump(ini_set("session.sid_length", "32"));
88var_dump(ini_set("session.sid_bits_per_character", "4"));
89var_dump(ini_set("session.lazy_write", "1"));
90
91
92echo "Done";
93ob_end_flush();
94?>
95--EXPECTF--
96*** Testing ini_set() for session ini: basic functionality ***
97string(0) ""
98string(9) "PHPSESSID"
99string(5) "files"
100bool(false)
101string(1) "1"
102string(3) "100"
103string(4) "1440"
104string(3) "php"
105string(1) "/"
106string(0) ""
107string(1) "0"
108string(1) "0"
109string(1) "1"
110string(1) "1"
111string(1) "0"
112string(0) ""
113string(7) "nocache"
114string(3) "180"
115string(1) "0"
116string(2) "32"
117string(1) "4"
118string(1) "1"
119string(15) "session started"
120
121Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
122bool(false)
123
124Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
125bool(false)
126
127Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
128bool(false)
129bool(false)
130
131Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
132bool(false)
133
134Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
135bool(false)
136
137Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
138bool(false)
139
140Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
141bool(false)
142
143Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
144bool(false)
145
146Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
147bool(false)
148
149Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
150bool(false)
151
152Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
153bool(false)
154
155Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
156bool(false)
157
158Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
159bool(false)
160
161Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
162bool(false)
163
164Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
165bool(false)
166
167Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
168bool(false)
169
170Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
171bool(false)
172
173Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
174bool(false)
175
176Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
177bool(false)
178
179Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
180bool(false)
181
182Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d
183bool(false)
184Done
185