We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8e0157 commit a75de16Copy full SHA for a75de16
ext/session/tests/session_set_cookie_params_variation8.phpt
@@ -0,0 +1,31 @@
1
+--TEST--
2
+Test session_set_cookie_params() function : negative and 0 lifetime
3
+--EXTENSIONS--
4
+session
5
+--SKIPIF--
6
+<?php include('skipif.inc'); ?>
7
+--FILE--
8
+<?php
9
+
10
+ob_start();
11
12
+var_dump(ini_get("session.cookie_lifetime"));
13
+var_dump(session_set_cookie_params(["lifetime" => 0]));
14
15
16
17
+var_dump(session_set_cookie_params(["lifetime" => -10]));
18
19
+echo "Done";
20
+ob_end_flush();
21
+?>
22
+--EXPECTF--
23
+string(1) "0"
24
+bool(true)
25
26
27
28
+Warning: session_set_cookie_params(): CookieLifetime cannot be negative in %s on line %d
29
+bool(false)
30
31
+Done
0 commit comments