faet: cookie

This commit is contained in:
박정민 2024-07-31 13:50:34 +09:00
parent 29e146253b
commit 9934fef06c

View File

@ -101,9 +101,10 @@ public class UserController {
Cookie refreshCookie = new Cookie("refresh-token", refreshToken); Cookie refreshCookie = new Cookie("refresh-token", refreshToken);
refreshCookie.setPath("/"); refreshCookie.setPath("/");
refreshCookie.setHttpOnly(true); refreshCookie.setHttpOnly(true);
// refreshCookie.setSecure(true); // HTTPS에서만 전송되도록 설정 refreshCookie.setSecure(true); // HTTPS에서만 전송되도록 설정
//r/efreshCookie.setSameSite(Cookie.SameSite.NONE); // Cross-Origin 요청에 대해 모두 전송 //r/efreshCookie.setSameSite(Cookie.SameSite.NONE); // Cross-Origin 요청에 대해 모두 전송
//refreshCookie.setSameSite("None"); // Cross-Origin 요청에 대해 모두 전송 //refreshCookie.setSameSite("None"); // Cross-Origin 요청에 대해 모두 전송
String cookieHeader = String.format("refresh-token=%s; Path=/; HttpOnly; Secure; SameSite=None", refreshToken); String cookieHeader = String.format("refresh-token=%s; Path=/; HttpOnly; Secure; SameSite=None", refreshToken);
response.setHeader("Set-Cookie", cookieHeader); response.setHeader("Set-Cookie", cookieHeader);