judu/ex-egopublic Fork
⑂ 57cf0d1
Commits
⬇ Clone ▾
git clone https://git.rickub.com/judu/ex-ego.git
git clone ssh://git@rickub.com/judu/ex-ego.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

Use SameSite=strict for session cookieUnverified

Julien Durillon committed 2026-08-06T23:26:50+02:00 Browse files
57cf0d1 parent: df9986a
modified src/auth/extractor.rs +1 -1
@@ -35,7 +35,7 @@ pub struct AuthRedirect;
3535
3636 impl IntoResponse for AuthRedirect {
3737 fn into_response(self) -> Response {
38- let clear = format!("{SESSION_COOKIE}=; Path=/; Max-Age=0; HttpOnly; SameSite=Lax");
38+ let clear = format!("{SESSION_COOKIE}=; Path=/; Max-Age=0; HttpOnly; SameSite=Strict");
3939 ([(SET_COOKIE, clear)], Redirect::to("/login")).into_response()
4040 }
4141 }
@@ -35,7 +35,7 @@ pub struct AuthRedirect;
35 35
36 impl IntoResponse for AuthRedirect {36 impl IntoResponse for AuthRedirect {
37 fn into_response(self) -> Response {37 fn into_response(self) -> Response {
38- let clear = format!("{SESSION_COOKIE}=; Path=/; Max-Age=0; HttpOnly; SameSite=Lax");38+ let clear = format!("{SESSION_COOKIE}=; Path=/; Max-Age=0; HttpOnly; SameSite=Strict");
39 ([(SET_COOKIE, clear)], Redirect::to("/login")).into_response()39 ([(SET_COOKIE, clear)], Redirect::to("/login")).into_response()
40 }40 }
41 }41 }
modified src/routes/login.rs +1 -1
@@ -61,7 +61,7 @@ pub async fn login_submit(
6161 .path("/")
6262 .http_only(true)
6363 .secure(true)
64- .same_site(SameSite::Lax)
64+ .same_site(SameSite::Strict)
6565 .max_age(time::Duration::seconds(SESSION_SECONDS));
6666 Ok((jar.add(cookie), Redirect::to("/")).into_response())
6767 }
@@ -61,7 +61,7 @@ pub async fn login_submit(
61 .path("/")61 .path("/")
62 .http_only(true)62 .http_only(true)
63 .secure(true)63 .secure(true)
64- .same_site(SameSite::Lax)64+ .same_site(SameSite::Strict)
65 .max_age(time::Duration::seconds(SESSION_SECONDS));65 .max_age(time::Duration::seconds(SESSION_SECONDS));
66 Ok((jar.add(cookie), Redirect::to("/")).into_response())66 Ok((jar.add(cookie), Redirect::to("/")).into_response())
67 }67 }