* Fix FE web insecure cookie setting #26056 * [Bug] FE web insecure cookie setting #26056
This commit is contained in:
@ -104,7 +104,11 @@ public class BaseController {
|
||||
protected void addSession(HttpServletRequest request, HttpServletResponse response, SessionValue value) {
|
||||
String key = UUID.randomUUID().toString();
|
||||
Cookie cookie = new Cookie(PALO_SESSION_ID, key);
|
||||
cookie.setSecure(false);
|
||||
if (Config.enable_https) {
|
||||
cookie.setSecure(true);
|
||||
} else {
|
||||
cookie.setSecure(false);
|
||||
}
|
||||
cookie.setMaxAge(PALO_SESSION_EXPIRED_TIME);
|
||||
cookie.setPath("/");
|
||||
cookie.setHttpOnly(true);
|
||||
@ -172,6 +176,12 @@ public class BaseController {
|
||||
if (cookie.getName() != null && cookie.getName().equals(cookieName)) {
|
||||
cookie.setMaxAge(age);
|
||||
cookie.setPath("/");
|
||||
cookie.setHttpOnly(true);
|
||||
if (Config.enable_https) {
|
||||
cookie.setSecure(true);
|
||||
} else {
|
||||
cookie.setSecure(false);
|
||||
}
|
||||
response.addCookie(cookie);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user