Skip to content

Comments

fix: 불필요한 세션이 생성되는 버그 해결#76

Merged
hisonghy merged 1 commit intodevelopfrom
fix/multiple-sessions-created-75
Apr 2, 2025
Merged

fix: 불필요한 세션이 생성되는 버그 해결#76
hisonghy merged 1 commit intodevelopfrom
fix/multiple-sessions-created-75

Conversation

@hisonghy
Copy link
Member

@hisonghy hisonghy commented Apr 2, 2025

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 카카오 로그인 API에서 클라이언트가 카카오 서버로부터 authorization code를 발급받고 /api/auth/kakao/callback 경로로 리다이렉트 될 때 서버에 세션이 생성되는 현상을 발견했습니다
  • 찾아보니 이는 스프링 시큐리티의 기본 동작으로, 인증되지 않은 사용자가 보호된 경로(인증이 필요한 경로, permitAll() 로 등록한 경로를 제외한 모든 경로)에 접근하면 추후 인증된 후 원래 요청으로 리다이렉트하기 위해 해당 요청 정보를 세션에 임시로 저장해둔다고 합니다
  • 이런 증상은 불필요한 세션을 생성하면서 성능 저하, 리소스 낭비 문제가 발생할 수 있다고 판단하고, 불필요한 세션이 생성되지 않도록 스프링 시큐리티 requestCache() 설정을 disabled 처리해 비활성화 시켰습니다

🔍 참고사항

📚 기타

@hisonghy hisonghy added the 🔴 bug/error 버그 수정(오류, 에러 해결) label Apr 2, 2025
@hisonghy hisonghy requested a review from myqewr April 2, 2025 06:41
@hisonghy hisonghy self-assigned this Apr 2, 2025
@hisonghy hisonghy merged commit 86cdafd into develop Apr 2, 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