Fix: ws session extraction
This commit is contained in:
parent
6bdfe87bc0
commit
bb093482a7
|
@ -271,12 +271,20 @@ class WSManager extends WebSocketServer
|
|||
{
|
||||
global $config;
|
||||
|
||||
$php_session_id = \str_replace(
|
||||
'PHPSESSID=',
|
||||
'',
|
||||
$user->headers['cookie']
|
||||
$match;
|
||||
$php_session_id = '';
|
||||
\preg_match(
|
||||
'/PHPSESSID=(.*)/',
|
||||
$user->headers['cookie'],
|
||||
$match
|
||||
);
|
||||
|
||||
if (is_array($match) === true) {
|
||||
$php_session_id = $match[1];
|
||||
}
|
||||
|
||||
$php_session_id = \preg_replace('/;.*$/', '', $php_session_id);
|
||||
|
||||
// If being redirected from proxy.
|
||||
if (isset($user->headers['x-forwarded-for']) === true) {
|
||||
$user->address = $user->headers['x-forwarded-for'];
|
||||
|
|
Loading…
Reference in New Issue