just strip the '.' from uniqid with added entropy. this way we dont run into any md5 collisions.

This commit is contained in:
Ben Connito 2014-09-15 17:01:24 -04:00
parent a6e7952671
commit f5d148cdc4

View File

@ -17,7 +17,7 @@ class WampConnection extends AbstractConnectionDecorator {
parent::__construct($conn); parent::__construct($conn);
$this->WAMP = new \StdClass; $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->WAMP->prefixes = array();
$this->send(json_encode(array(WAMP::MSG_WELCOME, $this->WAMP->sessionId, 1, \Ratchet\VERSION))); $this->send(json_encode(array(WAMP::MSG_WELCOME, $this->WAMP->sessionId, 1, \Ratchet\VERSION)));