1--TEST--
2Test session_set_cookie_params() function : negative and 0 lifetime
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php include('skipif.inc'); ?>
7--FILE--
8<?php
9
10ob_start();
11
12var_dump(ini_get("session.cookie_lifetime"));
13var_dump(session_set_cookie_params(["lifetime" => 0]));
14var_dump(ini_get("session.cookie_lifetime"));
15
16var_dump(ini_get("session.cookie_lifetime"));
17var_dump(session_set_cookie_params(["lifetime" => -10]));
18var_dump(ini_get("session.cookie_lifetime"));
19echo "Done";
20ob_end_flush();
21?>
22--EXPECTF--
23string(1) "0"
24bool(true)
25string(1) "0"
26string(1) "0"
27
28Warning: session_set_cookie_params(): CookieLifetime cannot be negative in %s on line %d
29bool(false)
30string(1) "0"
31Done
32