remove_cookie.rs 429 B

12345678910111213141516
  1. use actix_web::cookie::{Cookie, time::Duration};
  2. pub fn remove_cookie(name: String) -> Cookie<'static> {
  3. if cfg!(debug_assertions) {
  4. Cookie::build(name, "")
  5. .path("/")
  6. .max_age(Duration::ZERO)
  7. .finish()
  8. } else {
  9. Cookie::build(name, "")
  10. .domain("home.leemorgan.dev")
  11. .path("/")
  12. .max_age(Duration::ZERO)
  13. .finish()
  14. }
  15. }