Skip to content

Commit

Permalink
bugfix: make sure form resubmit cookie is secure
Browse files Browse the repository at this point in the history
  • Loading branch information
lprimak committed Sep 21, 2023
1 parent 62ef2b4 commit 6214edf
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static void addCookie(@NonNull HttpServletResponse response, ServletContext serv
var cookie = new Cookie(cokieName, cookieValue);
cookie.setPath(servletContext.getContextPath());
cookie.setMaxAge(maxAge);
cookie.setSecure(true);
response.addCookie(cookie);
}

Expand All @@ -53,6 +54,7 @@ static void deleteCookie(@NonNull HttpServletResponse response, ServletContext s
var cookieToDelete = new Cookie(cokieName, "tbd");
cookieToDelete.setPath(servletContext.getContextPath());
cookieToDelete.setMaxAge(0);
cookie.setSecure(true);
response.addCookie(cookieToDelete);
}

Expand Down

0 comments on commit 6214edf

Please sign in to comment.