summaryrefslogtreecommitdiff
path: root/ext/session/tests/bug67694.phpt
blob: a82a9fcbaf37c4d8225fcc932f9abf6e485675d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--TEST--
Bug #67694 Regression in session_regenerate_id()
--INI--
session.save_handler = files
session.name=PHPSESSID
session.auto_start = 0
session.use_cookies = 0
session.cache_limiter =
date.timezone = UTC
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
ob_start();
$data = date('r');

session_start();
$id = session_id();
$_SESSION['init'] = $data;

session_write_close();

session_id($id);
session_start();

session_regenerate_id(false);

$newid = session_id();
var_dump($newid != $id);

session_write_close();

unset($_SESSION);

session_id($newid);
session_start();

var_dump(isset($_SESSION['init']) && $data == $_SESSION['init']);
--EXPECT--
bool(true)
bool(true)