public function generateToken() { if (isset($this->token)) { return; } $this->token = base_convert(md5(uniqid(rand(), true)), 16, 36); setcookie($this->getCookieName(), $this->token, time() + 3600, '/'); }