From 705423e0b3beabf9628206ffb0c1c828fcdb11ef Mon Sep 17 00:00:00 2001 From: Ben Connito Date: Thu, 7 Aug 2014 13:35:01 -0400 Subject: [PATCH] more entropy on session id all tests passing --- src/Ratchet/Wamp/WampConnection.php | 2 +- tests/unit/Wamp/TopicTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ratchet/Wamp/WampConnection.php b/src/Ratchet/Wamp/WampConnection.php index a0bf523..a12b162 100644 --- a/src/Ratchet/Wamp/WampConnection.php +++ b/src/Ratchet/Wamp/WampConnection.php @@ -17,7 +17,7 @@ class WampConnection extends AbstractConnectionDecorator { parent::__construct($conn); $this->WAMP = new \StdClass; - $this->WAMP->sessionId = uniqid(); + $this->WAMP->sessionId = md5(uniqid(mt_rand(), true)); $this->WAMP->prefixes = array(); $this->send(json_encode(array(WAMP::MSG_WELCOME, $this->WAMP->sessionId, 1, \Ratchet\VERSION))); diff --git a/tests/unit/Wamp/TopicTest.php b/tests/unit/Wamp/TopicTest.php index b8685b7..26db0d3 100644 --- a/tests/unit/Wamp/TopicTest.php +++ b/tests/unit/Wamp/TopicTest.php @@ -81,7 +81,7 @@ class TopicTest extends \PHPUnit_Framework_TestCase { $topic->add($first); $topic->add($second); $topic->add($third); - + $topic->broadcast($msg, array($second->WAMP->sessionId)); }