I am using websocket code from https://github.com/Flynsarmy/PHPWebSocket-Chat
I already have my custom users account with Mysql where user logs in at login.php connected to websocket. Thus I set session/cookie for the particular user. For an example
$_SESSION["user"] = 'xyz';//User is created.
The issue is when I try to use $_SESSION even with session_id(). I failed to get $_SESSION values. I am doing this in server.php which is suppose to be running with php server.php command. I try code below.
session_id("lsjdfjl');
@session_start();
$user = $_SESSION["user"];
And I get error message saying undefine index ...
Is there any alternative way to combine above Websocket server with custom user datab ase and create seperate chatroom for different logged in users. For example FB chat/gmail chat system.