From c2642e1c74af278668060ed133dad3f25065533b Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Thu, 26 Apr 2012 20:01:12 -0400 Subject: [PATCH] [WAMP] Store sessionId in Connection --- src/Ratchet/Component/WAMP/WAMPServerComponent.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Ratchet/Component/WAMP/WAMPServerComponent.php b/src/Ratchet/Component/WAMP/WAMPServerComponent.php index d9e5de9..4a4c6e3 100644 --- a/src/Ratchet/Component/WAMP/WAMPServerComponent.php +++ b/src/Ratchet/Component/WAMP/WAMPServerComponent.php @@ -77,6 +77,7 @@ class WAMPServerComponent implements WebSocketComponentInterface { */ public function onOpen(ConnectionInterface $conn) { $conn->WAMP = new \StdClass; + $conn->WAMP->sessionId = uniqid(); $conn->WAMP->prefixes = array(); $conn->WAMP->subscriptions = array(); @@ -86,7 +87,7 @@ class WAMPServerComponent implements WebSocketComponentInterface { }; $welcome = new Welcome($conn); - $welcome->setWelcome(uniqid(), 'Ratchet/0.1'); + $welcome->setWelcome($conn->WAMP->sessionId, 'Ratchet/0.1'); $this->_msg_buffer->enqueue($welcome); return $this->attachStack($this->_decorating->onOpen($conn));