I need an 'unique' identifier on many controllers, so I thought i'd do something like this:
class ControllerBase extends Controller
{
public function initialize() {
if (!$this->cookies->has('identifier')) {
$this->cookies->set('identifier', uniqid(mt_rand(), true), time() + 15 * 86400);
}
}
}
It doesn't seem to work however? :/