Skip to content

Commit 7870f70

Browse files
committed
HotFix: Cookie 생성 도메인 추가
1 parent fa2b7ab commit 7870f70

File tree

1 file changed

+3
-2
lines changed
  • backend/src/main/java/com/together/backend/global/security/jwt/util

1 file changed

+3
-2
lines changed

backend/src/main/java/com/together/backend/global/security/jwt/util/CookieUtil.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
public class CookieUtil {
1414

1515
public static String getCookieValue(HttpServletRequest request, String name) {
16+
1617
if (request.getCookies() == null) {
1718
log.warn("@@@@@getCookieValue:null@@@@@");
1819
return null;
@@ -31,15 +32,15 @@ public static String getCookieValue(HttpServletRequest request, String name) {
3132
public static void createCookie(HttpServletResponse response, String name, String value) {
3233
int maxAge = 60 * 60 * 12; // 12시간
3334
String cookieValue = String.format(
34-
"%s=%s; Path=/; Max-Age=%d; Secure; HttpOnly; SameSite=None",
35+
"%s=%s; Path=/; Max-Age=%d; Secure; HttpOnly; SameSite=None; Domain=7-together.kro.kr",
3536
name, value, maxAge
3637
);
3738
response.addHeader("Set-Cookie", cookieValue); // addHeader로 여러 개 가능
3839
}
3940

4041
public static void expireCookie(HttpServletResponse response, String name) {
4142
String expiredCookie = String.format(
42-
"%s=; Path=/; Max-Age=0; Secure; HttpOnly; SameSite=None",
43+
"%s=; Path=/; Max-Age=0; Secure; HttpOnly; SameSite=None; Domain=7-together.kro.kr",
4344
name
4445
);
4546
response.addHeader("Set-Cookie", expiredCookie);

0 commit comments

Comments
 (0)