How can I get $_SESSION data from SESSID?
问题 I have a PHP websocket server (https://github.com/lemmingzshadow/php-websocket/). When an user connects, I want to set/get some session data. The problem is that I can't use $_SESSION because if I do that, instead of clients' session I get the session of my websocket server. I have managed to get clients' SESSID: private function handshake($data) { $this->log('Performing handshake'); if(preg_match("/PHPSESSID=(.*?)(?:;|\r\n)/", $data, $matches)){ $sessid = $matches[1]; } /* Do handshake */ }