diff --git a/user/src/main/java/com/weather/user/security/handler/LoginSuccessHandler.java b/user/src/main/java/com/weather/user/security/handler/LoginSuccessHandler.java index 76de07a..704c175 100644 --- a/user/src/main/java/com/weather/user/security/handler/LoginSuccessHandler.java +++ b/user/src/main/java/com/weather/user/security/handler/LoginSuccessHandler.java @@ -46,11 +46,13 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo Cookie cookieToken = new Cookie("token", token); cookieToken.setHttpOnly(false); // JavaScript를 통한 쿠키 접근을 막기 위해 사용 cookieToken.setMaxAge(3 * 60 * 60); + cookieToken.setSecure(true); response.addCookie(cookieToken); String userinfo = authUserDTO.getEmail() + "|" + authUserDTO.getName() + "|" + authUserDTO.getImage(); Cookie cookieUserinfo = new Cookie("userinfo", userinfo); cookieUserinfo.setHttpOnly(false); + cookieToken.setSecure(true); cookieUserinfo.setMaxAge(3 * 60 * 60); response.addCookie(cookieUserinfo);