xref: /PHP-7.4/ext/session/tests/bug67694.phpt (revision f34b858e)
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--SKIPIF--
11<?php include('skipif.inc'); ?>
12--FILE--
13<?php
14ob_start();
15$data = date('r');
16
17session_start();
18$id = session_id();
19$_SESSION['init'] = $data;
20
21session_write_close();
22
23session_id($id);
24session_start();
25
26session_regenerate_id(false);
27
28$newid = session_id();
29var_dump($newid != $id);
30
31session_write_close();
32
33unset($_SESSION);
34
35session_id($newid);
36session_start();
37
38var_dump(isset($_SESSION['init']) && $data == $_SESSION['init']);
39--EXPECT--
40bool(true)
41bool(true)
42