Пример #1
0
 private Response set(final Request request, final Response response, final Cookie cookie) {
   if (cookieAlreadyHasSameValue(request, cookie)
       || (isEmptyJson(cookie.value()) && !request.cookies().contains(FLASH_COOKIE))) {
     return response;
   }
   return response.cookie(cookie);
 }
Пример #2
0
 /** This is designed to be lossy as Request Cookies never have attributes */
 default Request cookie(Cookie cookie) {
   return cookie(cookie.name(), cookie.value());
 }
Пример #3
0
 private boolean cookieAlreadyHasSameValue(final Request request, final Cookie cookie) {
   return cookie.value().equals(request.cookies().getValue(FLASH_COOKIE));
 }