- secure session cookie 설정 및 same-site 설정
*참고
1. pplication.yml의 server.servlet.cookie 설정은 내장 톰캣에만 적용 됨.
2. secure: true 설정은 HTTPS 환경에서만 쿠키를 저장 됨.
3. same-site: NONE 설정은 secure: true와 함께 사용해야 함.
* 문제 해결
1. 개발 환경에서는 secure: false, same-site: LAX로 설정해 테스트.
2. 쿠키 저장 시 HttpServletResponse에 직접 추가
## 운영
server:
servlet:
session:
cookie:
# 쿠키 보안 설정 (운영)
http-only: true
secure: true
same-site: NONE
## 로컬/개발
server:
servlet:
session:
cookie:
# 쿠키 보안
http-only: false
secure: false
same-site: LAX
- session control
https://www.baeldung.com/spring-security-session
Control the Session with Spring Security | Baeldung
Configure Sessions with Spring Security - set up Concurrent Sessions, enable Session Fixation Protection and prevent URLs from containing Session information.
www.baeldung.com
- 로그아웃시 사이트 정보 제거
https://www.baeldung.com/spring-security-clear-site-data-header
The Clear-Site-Data Header in Spring Security | Baeldung
Learn how to use Spring Security's with ClearSiteDataHeaderWriter to add the HTTP Clear-Site-Data response header
www.baeldung.com
'spring-security' 카테고리의 다른 글
| HttpFirewall (0) | 2020.11.25 |
|---|---|
| spring-security autoconfiguration disable (0) | 2020.11.11 |
| 권한 및 로그인 후 부가작업 (0) | 2020.08.14 |
| rest login & ajax login (0) | 2020.07.19 |
| CSRF 관련 (0) | 2020.07.17 |

