1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
public static void addCookie(HttpServletResponse response, String name, String value, String sSameSite) {
ResponseCookie cookie = ResponseCookie.from(name, value)
.path("/kcu")
.sameSite(sSameSite)
.httpOnly(true)
.secure(true) //-> secure 옵션을 true로 변경한다.
//.maxAge(maxAge)
.build();
response.addHeader("Set-Cookie", cookie.toString());
}
....
// sameSite=None 처리
addCookie(response,"JSESSIONID",request.getSession().getId(),"None");
....
// None이 아니게 복구하기
addCookie(response,"JSESSIONID",request.getSession().getId(),"");
|
cs |
'업무관련 > 스프링' 카테고리의 다른 글
postgreSQL 문자컬럼 숫자 증가시키기 (1) | 2024.01.04 |
---|---|
html select태그 대분류 변경시 소분류 리스트 변경 (0) | 2023.12.28 |
websocket으로 채팅방 만들기 (0) | 2023.07.11 |
페이징 알고리즘 간단한 코드 paging code (0) | 2023.03.31 |
gitignore 깃허브 Spring 공유하기 (0) | 2023.03.31 |