Skip to content

Commit

Permalink
add: cookie에 samesite=none 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Bellroute committed Jun 15, 2024
1 parent 76c8f45 commit 8376e9e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.Optional;
import org.apache.tomcat.util.descriptor.web.Constants;

// [reference] https://velog.io/@cutepassions/spring-security-%EC%84%A4%EC%A0%95-3-cookie
public class CookieUtils {
Expand Down Expand Up @@ -39,9 +40,11 @@ public static void addCookie(HttpServletRequest request, HttpServletResponse res
cookie.setDomain(domain);
}

cookie.setSecure(true);
cookie.setPath("/");
cookie.setHttpOnly(true);
cookie.setMaxAge(maxAge);
cookie.setAttribute(Constants.COOKIE_SAME_SITE_ATTR, "None");
response.addCookie(cookie);
}

Expand Down

0 comments on commit 8376e9e

Please sign in to comment.