cookie max age from "session end" to "10 years"

This commit is contained in:
Patrick Haßel 2024-10-24 16:22:33 +02:00
parent 962e390b5d
commit d1521417cf

View File

@ -89,12 +89,13 @@ public class UserService {
}
private static void writeUserUuidCookie(@NonNull final HttpServletResponse response, @Nullable final User user) {
final Cookie userUuidCookie = new Cookie(USER_UUID_COOKIE_NAME, "");
final Cookie cookie = new Cookie(USER_UUID_COOKIE_NAME, "");
if (user != null) {
userUuidCookie.setValue(user.privateUuid);
cookie.setValue(user.privateUuid);
}
userUuidCookie.setPath("/");
response.addCookie(userUuidCookie);
cookie.setMaxAge(10 * 365 * 24 * 60 * 60);
cookie.setPath("/");
response.addCookie(cookie);
}
@NonNull