1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/session/tests/bug79413.phpt
Christoph M. Becker b510250b8e Fix #79413: session_create_id() fails for active sessions
The comment on `PS_VALIDATE_SID_FUNC(files)` is very clear that the
function is supposed to return `SUCCESS` if the session already exists.
So to detect a collision, we have to check for `SUCCESS`, not
`FAILURE`.

We also fix the wrong condition in session_regenerate_id() as well.
2020-03-31 08:38:23 +02:00

16 lines
298 B
PHP

--TEST--
Bug #79413 (session_create_id() fails for active sessions)
--SKIPIF--
<?php
if (!extension_loaded('session')) die('skip session extension not available');
?>
--FILE--
<?php
session_start();
$old = session_id();
$new = session_create_id();
var_dump($new !== $old);
?>
--EXPECT--
bool(true)