xref: /PHP-8.1/ext/session/tests/bug67694.phpt (revision b5a14e6c)
1--TEST--
2Bug #67694 Regression in session_regenerate_id()
3--INI--
4session.save_handler = files
5session.name=PHPSESSID
6session.auto_start = 0
7session.use_cookies = 0
8session.cache_limiter =
9date.timezone = UTC
10--EXTENSIONS--
11session
12--SKIPIF--
13<?php include('skipif.inc'); ?>
14--FILE--
15<?php
16ob_start();
17$data = date('r');
18
19session_start();
20$id = session_id();
21$_SESSION['init'] = $data;
22
23session_write_close();
24
25session_id($id);
26session_start();
27
28session_regenerate_id(false);
29
30$newid = session_id();
31var_dump($newid != $id);
32
33session_write_close();
34
35unset($_SESSION);
36
37session_id($newid);
38session_start();
39
40var_dump(isset($_SESSION['init']) && $data == $_SESSION['init']);
41?>
42--EXPECT--
43bool(true)
44bool(true)
45