protected function getTokenFromCookie()
    {
        $cookies = $this->getCookies();
        if (!empty($cookies['token']) && $cookies['token']['expiration'] > time()) {
            return $cookies['token']['value'];
        }

        return null;
    }