diff --git a/lib/csurf/src/future.rs b/lib/csurf/src/future.rs index b7313ea15..35fa11f6f 100644 --- a/lib/csurf/src/future.rs +++ b/lib/csurf/src/future.rs @@ -1,5 +1,5 @@ use crate::{CsrfHandle, CSRF_COOKIE_NAME}; -use cookie::{Cookie, SameSite}; +use cookie::{Cookie, Expiration, SameSite}; use http::{header, HeaderValue, Response}; use pin_project_lite::pin_project; use std::{ @@ -27,6 +27,7 @@ where let mut response = ready!(this.inner.poll(cx))?; let mut cookie = Cookie::build(CSRF_COOKIE_NAME) + .expires(Expiration::Session) .permanent() .same_site(SameSite::Strict) .secure(true)