1️⃣ HttpSession 이란?Servlet 컨테이너(Tomcat) 가 관리하는 서버 측 세션 객체클라이언트당 1개식별자는 JSESSIONID 쿠키Spring Security 는 필요할 때만 HttpSession 을 사용(기본 설정)보통 Spring Security 인증 성공 후 SecurityContextRepository 를 통해 인증정보를 저장한다. 2️⃣ HttpSession은 언제 생성될까?❌ 자동 생성되지 않는다HttpSession 은 요청이 왔다고 해서 무조건 생성되지 않는다.// HttpServletRequest requestrequest.getSession(false); // 세션 없으면 nullrequest.getSession(); // 없으면 생성 ✅ 생성되는 대표적인 경..
HttpSession 생명주기 (SecurityContextHolderFilter, HttpSessionSecurityContextRepository)
1️⃣ HttpSession 이란?Servlet 컨테이너(Tomcat) 가 관리하는 서버 측 세션 객체클라이언트당 1개식별자는 JSESSIONID 쿠키Spring Security 는 필요할 때만 HttpSession 을 사용(기본 설정)보통 Spring Security 인증 성공 후 SecurityContextRepository 를 통해 인증정보를 저장한다. 2️⃣ HttpSession은 언제 생성될까?❌ 자동 생성되지 않는다HttpSession 은 요청이 왔다고 해서 무조건 생성되지 않는다.// HttpServletRequest requestrequest.getSession(false); // 세션 없으면 nullrequest.getSession(); // 없으면 생성 ✅ 생성되는 대표적인 경..
2025.12.31