public void auth(HttpServletRequest request, HttpServletResponse response, User user) throws AuthenticationException {
        boolean rememberMe = Boolean.valueOf(request.getParameter(Constants.RequestParameter.REMEMBER_ME));
        if (storage.exists(user.getEmail()))
            if (!user.getPassword().equals(storage.find(user.getEmail()).getPassword()))
                throw new AuthenticationException("password for User ", Base64Utils.encode(user.getEmail()), "is wrong");
        storage.save(user);
        request.getSession(true).setAttribute(Constants.Session.CURRENT_USER, user);
        if (rememberMe) {
            CookieUtils.createLoginCookie(response, user);
        }
    }