Skip to content

Commit

Permalink
feat(session): session log 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
junhyeongkim2 committed Oct 28, 2024
1 parent f0411d5 commit dc9cfac
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public Map<String, Object> checkSession(HttpServletRequest request, HttpServletR
HttpSession session = request.getSession(false);
info.put("hasSession", session != null);



// 요청에 포함된 모든 쿠키 정보
Cookie[] cookies = request.getCookies();
if (cookies != null) {
Expand All @@ -96,6 +98,13 @@ public Map<String, Object> checkSession(HttpServletRequest request, HttpServletR
info.put("requestURL", request.getRequestURL().toString());

log.info("Session check: {}", info);
if (session != null) {
log.debug("현재 세션 정보 - ID: {}, 생성시간: {}, 마지막접근: {}, 만료시간: {}",
session.getId(),
new Date(session.getCreationTime()),
new Date(session.getLastAccessedTime()),
session.getMaxInactiveInterval());
}

return info;
}
Expand Down

0 comments on commit dc9cfac

Please sign in to comment.