From f5d148cdc426e7209ee2bbd44fa4a9b9df54a81c Mon Sep 17 00:00:00 2001 From: Ben Connito Date: Mon, 15 Sep 2014 17:01:24 -0400 Subject: [PATCH] just strip the '.' from uniqid with added entropy. this way we dont run into any md5 collisions. --- src/Ratchet/Wamp/WampConnection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ratchet/Wamp/WampConnection.php b/src/Ratchet/Wamp/WampConnection.php index a12b162..8364efd 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 = md5(uniqid(mt_rand(), true)); + $this->WAMP->sessionId = str_replace('.','',uniqid(mt_rand(), true)); $this->WAMP->prefixes = array(); $this->send(json_encode(array(WAMP::MSG_WELCOME, $this->WAMP->sessionId, 1, \Ratchet\VERSION)));