1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

Update Composer dependencies.

This commit is contained in:
Caleb Mazalevskis 2022-06-18 17:18:18 +08:00
parent 1a439466d5
commit 9bba3f4066
No known key found for this signature in database
GPG key ID: 082E6BC1046FAB95
440 changed files with 17739 additions and 8623 deletions

View file

@ -145,6 +145,12 @@ class NativeSessionStorage implements SessionStorageInterface
throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line));
}
$sessionId = $_COOKIE[session_name()] ?? null;
if ($sessionId && !preg_match('/^[a-zA-Z0-9,-]{22,}$/', $sessionId)) {
// the session ID in the header is invalid, create a new one
session_id(session_create_id());
}
// ok to try and start the session
if (!session_start()) {
throw new \RuntimeException('Failed to start the session.');