xref: /PHP-8.1/ext/session/tests/bug72940.phpt (revision b5a14e6c)
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--EXPECT--
35string(12) "bug72940test"
36string(0) ""
37string(11) "bug72940get"
38string(21) "PHPSESSID=bug72940get"
39