Skip to content

Commit

Permalink
Persist session cookie longer
Browse files Browse the repository at this point in the history
  • Loading branch information
rgwood committed Sep 19, 2024
1 parent 5e2c7a0 commit e03ccd8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reitunes-rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ async fn login_post_handler(
let mut cookie = Cookie::new(SESSION_COOKIE_NAME, PASSWORD_HASH.as_str());
cookie.set_http_only(true);
cookie.set_path("/");
let one_year = tower_cookies::cookie::time::Duration::seconds(60 * 60 * 24 * 365);
cookie.set_max_age(Some(one_year));
cookies.add(cookie);
return Redirect::to("/").into_response();
}
Expand Down

0 comments on commit e03ccd8

Please sign in to comment.