1--TEST--
2Test session_set_cookie_params() function : variation
3--INI--
4session.cookie_lifetime=3600
5--SKIPIF--
6<?php include('skipif.inc'); ?>
7--FILE--
8<?php
9
10ob_start();
11
12/*
13 * Prototype : void session_set_cookie_params(int $lifetime [, string $path [, string $domain [, bool $secure [, bool $httponly]]]])
14 * Description : Set the session cookie parameters
15 * Source code : ext/session/session.c
16 */
17
18echo "*** Testing session_set_cookie_params() : variation ***\n";
19
20var_dump(ini_get("session.cookie_lifetime"));
21var_dump(session_set_cookie_params(3600));
22var_dump(ini_get("session.cookie_lifetime"));
23
24var_dump(session_start());
25var_dump(ini_get("session.cookie_lifetime"));
26var_dump(session_set_cookie_params(1800));
27var_dump(ini_get("session.cookie_lifetime"));
28var_dump(session_destroy());
29
30var_dump(ini_get("session.cookie_lifetime"));
31var_dump(session_set_cookie_params(1234567890));
32var_dump(ini_get("session.cookie_lifetime"));
33
34echo "Done";
35ob_end_flush();
36?>
37--EXPECTF--
38*** Testing session_set_cookie_params() : variation ***
39string(4) "3600"
40bool(true)
41string(4) "3600"
42bool(true)
43string(4) "3600"
44
45Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 19
46bool(false)
47string(4) "3600"
48bool(true)
49string(4) "3600"
50bool(true)
51string(10) "1234567890"
52Done
53