Skip to content

Commit

Permalink
Short time-to-life for registration cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Dec 15, 2023
1 parent bb03b16 commit 5a49eb4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public Map<String, Object> config() {
public void register(@RequestParam(value = "lang", required = false, defaultValue = "en") String lang,
@RequestParam(value = "location", required = false) String location,
HttpServletResponse response) throws IOException {
response.setHeader("Set-Cookie", REGISTER_MODUS_COOKIE_NAME + "=true; SameSite=None" + (secureCookie ? "; Secure" : ""));
String cookieValue = String.format("%s=true; Max-Age=%s; SameSite=None%s", REGISTER_MODUS_COOKIE_NAME, 60 * 10, secureCookie ? "; Secure" : "");
response.setHeader("Set-Cookie", cookieValue);
String redirectLocation = StringUtils.hasText(location) ? location : this.config.get("eduIDLoginUrl") + "&lang=" + lang;
response.sendRedirect(redirectLocation);
}
Expand Down

0 comments on commit 5a49eb4

Please sign in to comment.