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 162e7dc commit 16b4ee0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/java/com/mpnp/baechelin/util/CookieUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,20 @@ public static void deleteCookie(HttpServletRequest request, HttpServletResponse
if (cookies != null && cookies.length > 0) {
for (Cookie cookie : cookies) {
if (name.equals(cookie.getName())) {
Cookie deleteCookie = new Cookie(name, null);
deleteCookie.setMaxAge(0);
ResponseCookie deleteCookie = ResponseCookie.from(name, null)
.domain(".bae-chelin.com")
.path("/")
.httpOnly(true)
.maxAge(0)
.secure(true)
.sameSite("None")
.build();

// cookie.setValue("");
// cookie.setPath("/");
// cookie.setMaxAge(0);

response.addCookie(deleteCookie);
response.addHeader("Set-Cookie", cookie.toString());
}
}
}
Expand Down

0 comments on commit 16b4ee0

Please sign in to comment.