Skip to content

Comments

fix: 로그아웃 시 클라이언트 세션 쿠키를 초기화하도록 수정#119

Merged
hisonghy merged 1 commit intodevelopfrom
fix/logout-session-cookie-clear-118
May 12, 2025
Merged

fix: 로그아웃 시 클라이언트 세션 쿠키를 초기화하도록 수정#119
hisonghy merged 1 commit intodevelopfrom
fix/logout-session-cookie-clear-118

Conversation

@hisonghy
Copy link
Member

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 현재 세션이 만료될 경우, 클라이언트에서 세션 쿠키를 조작할 수 없는 문제가 발생해 수정했습니다.
  • 서버에서 세션 쿠키를 발급할 때, setHttpOnly(true) 설정을 추가해서 클라이언트에서 쿠키를 조작할 수 없어 서버에서 세션 쿠키를 초기화하도록 수정했습니다
  • Spring Session 을 사용하면 session.invalidate() 로직을 수행하면서 자동으로 관련 세션 쿠키를 초기화해주지만, 세션 쿠키이름이 바뀌거나 확장성면에서 명시적으로 addCookie()를 통해 쿠키를 초기화하도록 수정했습니다
  • 클라이언트에서 세션 만료 시 로그아웃 요청을 해야하기 때문에 로그아웃 API를 Spring Security permitAll 경로에 추가해줬습니다

🔍 참고사항

📚 기타

@hisonghy hisonghy requested a review from myqewr May 12, 2025 06:24
@hisonghy hisonghy self-assigned this May 12, 2025
@hisonghy hisonghy added the 🔴 bug/error 버그 수정(오류, 에러 해결) label May 12, 2025
@hisonghy hisonghy force-pushed the fix/logout-session-cookie-clear-118 branch from 05eaec0 to 26a6471 Compare May 12, 2025 06:45
@hisonghy hisonghy merged commit a3de76d into develop May 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔴 bug/error 버그 수정(오류, 에러 해결)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🔴 로그아웃 시 세션 쿠키가 삭제되지 않는 문제 수정

2 participants