Skip to content

Commit a75f015

Browse files
committed
♻️ 쿠키유틸 @value 관련 에러 수정
1 parent 6e628e4 commit a75f015

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/java/com/boggle_boggle/bbegok/utils/CookieUtil.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@
99
import org.springframework.beans.factory.annotation.Value;
1010
import org.springframework.http.HttpHeaders;
1111
import org.springframework.http.ResponseCookie;
12+
import org.springframework.stereotype.Component;
1213
import org.springframework.util.SerializationUtils;
1314

1415
import java.util.Base64;
1516
import java.util.Optional;
1617

1718
@Slf4j
19+
@Component
1820
public class CookieUtil {
19-
@Value("${bbaegok.root-domain}")
2021
private static String domain;
22+
private CookieUtil() {};
23+
24+
@Value("${bbaegok.root-domain}")
25+
public void setDomain(String domain) {
26+
CookieUtil.domain = domain;
27+
}
2128

2229
public static Optional<Cookie> getCookie(HttpServletRequest request, String name) {
2330
Cookie[] cookies = request.getCookies();
@@ -32,7 +39,6 @@ public static Optional<Cookie> getCookie(HttpServletRequest request, String name
3239
}
3340

3441
public static void addCookie(HttpServletResponse response, String name, String value, int maxAge) {
35-
System.out.println("Cooooooooooooooooooookie : "+domain);
3642
ResponseCookie cookie = ResponseCookie.from(name, value)
3743
.path("/")
3844
.domain(domain) // 루트도메인: bbaegok.store

0 commit comments

Comments
 (0)