mirror of
https://github.com/php/php-src.git
synced 2026-03-26 01:02:25 +01:00
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.
16 lines
298 B
PHP
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)
|