Skip to content

Commit

Permalink
#35 [Update] 쿠키 삭제 문제 두번째 시도
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna-Jin committed Jul 19, 2022
1 parent 778a1fb commit 162e7dc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/com/mpnp/baechelin/util/CookieUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@ public static void deleteCookie(HttpServletRequest request, HttpServletResponse
if (cookies != null && cookies.length > 0) {
for (Cookie cookie : cookies) {
if (name.equals(cookie.getName())) {
cookie.setValue("");
cookie.setPath("/");
cookie.setMaxAge(0);
Cookie deleteCookie = new Cookie(name, null);
deleteCookie.setMaxAge(0);

response.addHeader("Set-Cookie", cookie.toString());
// cookie.setValue("");
// cookie.setPath("/");
// cookie.setMaxAge(0);

response.addCookie(deleteCookie);
}
}
}
Expand Down

0 comments on commit 162e7dc

Please sign in to comment.