public function middleware($middleware)
    {
        $key = Configure::read('Security.cookieKey', md5(Configure::read('Security.salt')));

        return $middleware->add(new EncryptedCookieMiddleware(['login'], $key));
    }