1--TEST--
2Test session_set_cookie_params() function : variation
3--INI--
4session.cookie_path=/path
5--EXTENSIONS--
6session
7--SKIPIF--
8<?php include('skipif.inc'); ?>
9--FILE--
10<?php
11
12ob_start();
13
14echo "*** Testing session_set_cookie_params() : variation ***\n";
15
16var_dump(ini_get("session.cookie_path"));
17var_dump(session_set_cookie_params(3600, "/foo"));
18var_dump(ini_get("session.cookie_path"));
19var_dump(session_start());
20var_dump(ini_get("session.cookie_path"));
21var_dump(session_set_cookie_params(3600, "/blah"));
22var_dump(ini_get("session.cookie_path"));
23var_dump(session_destroy());
24var_dump(ini_get("session.cookie_path"));
25var_dump(session_set_cookie_params(3600, "/guff"));
26var_dump(ini_get("session.cookie_path"));
27
28echo "Done";
29ob_end_flush();
30?>
31--EXPECTF--
32*** Testing session_set_cookie_params() : variation ***
33string(5) "/path"
34bool(true)
35string(4) "/foo"
36bool(true)
37string(4) "/foo"
38
39Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d
40bool(false)
41string(4) "/foo"
42bool(true)
43string(4) "/foo"
44bool(true)
45string(5) "/guff"
46Done
47