Hello Everybody,
I use ratchet with memcache session like descripted here:
http://socketo.me/docs/sessionsI noticed the following:
1. Setting a session variable via HTTP Web Server
$session->set('uname', $uname);
2. Open new browser window and connect to websocket
3. Read the session data in onMessage
public function onMessage(ConnectionInterface $conn, $msg) {
$conn->Session->get("uname");
}
this works, the uname is correct.
4. change the session variable in window 1 or remove it
$session->remove('uname');
$session->invalidate();
5. call onMessage again in second browser window (see step 3.)
the uname isset and has the same value as before.
It seems to be the case that the session update has not been commited to ratchet or to memcache.
I dont know how memcache works internaly but i thought the session object will syncronized to each instance.
This seems to be not the case. If i have multiple instances opened and i destroy the session in one of them then the session will not be destroyed in the other instances.
Is this the correct behaviour?
I searched for something like $session->commit(); but there is none.
It seems to be the case that the ratchet server loads the session data once on connect and after that the ratchet session object is independent from the http clients one.
Can you confirm that?