Skip to content

Commit

Permalink
set global paths for cookie toast alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
PizieDust committed Jan 15, 2025
1 parent e2bb862 commit 71aa6c5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions middleware.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ let apply_middleware middlewares handler =
let redirect_to_page ~path ?(clear_session = false) ?(with_error = false) reqd
?(msg = "") () =
let msg_cookie =
if with_error then "flash_msg=error: " ^ Uri.pct_encode msg ^ ";"
else "flash_msg=" ^ Uri.pct_encode msg ^ ";"
if with_error then "flash_msg=error: " ^ Uri.pct_encode msg ^ ";Path=/;"
else "flash_msg=" ^ Uri.pct_encode msg ^ ";Path=/;"
in
let header_list =
let session_header =
if clear_session then
[
( "Set-Cookie",
User_model.session_cookie
^ "=; Path=/; HttpOnly=true; Expires=2023-10-27T11:00:00.778Z" );
("Set-Cookie", User_model.session_cookie ^ "=; Path=/; HttpOnly=true;");
]
else []
in
Expand Down

0 comments on commit 71aa6c5

Please sign in to comment.