Esempio n. 1
0
  public static void addSupportCookie(HttpServletRequest request, HttpServletResponse response) {

    Cookie cookieSupportCookie = new Cookie(COOKIE_SUPPORT, "true");

    cookieSupportCookie.setPath(StringPool.SLASH);
    cookieSupportCookie.setMaxAge(MAX_AGE);

    addCookie(request, response, cookieSupportCookie);
  }
  @Override
  public void updateCookie(
      HttpServletRequest request, HttpServletResponse response, Locale locale) {

    String languageId = LocaleUtil.toLanguageId(locale);

    Cookie languageIdCookie = new Cookie(CookieKeys.GUEST_LANGUAGE_ID, languageId);

    languageIdCookie.setPath(StringPool.SLASH);
    languageIdCookie.setMaxAge(CookieKeys.MAX_AGE);

    CookieKeys.addCookie(request, response, languageIdCookie);
  }
Esempio n. 3
0
  public static void addCookie(
      HttpServletRequest request, HttpServletResponse response, Cookie cookie) {

    addCookie(request, response, cookie, request.isSecure());
  }