xref: /PHP-8.4/ext/session/tests/bug72940.phpt (revision c5bce0d8)
1--TEST--
2Bug #72940 - SID always defined
3--INI--
4error_reporting=-1
5session.save_path=
6session.name=PHPSESSID
7session.save_handler=files
8--EXTENSIONS--
9session
10--SKIPIF--
11<?php include('skipif.inc'); ?>
12--COOKIE--
13PHPSESSID=bug72940test
14--GET--
15PHPSESSID=bug72940get
16--FILE--
17<?php
18ob_start();
19
20ini_set('session.use_strict_mode', 0);
21ini_set('session.use_cookies', 1);
22ini_set('session.use_only_cookies', 0);
23session_start();
24var_dump(session_id(), SID);
25session_destroy();
26
27ini_set('session.use_strict_mode', 0);
28ini_set('session.use_cookies', 0);
29ini_set('session.use_only_cookies', 0);
30session_start();
31var_dump(session_id(), SID);
32session_destroy();
33?>
34--EXPECTF--
35Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 6
36
37Deprecated: Constant SID is deprecated in %s on line 8
38string(12) "bug72940test"
39string(0) ""
40
41Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 13
42
43Deprecated: Constant SID is deprecated in %s on line 15
44string(11) "bug72940get"
45string(21) "PHPSESSID=bug72940get"
46