useactix_web::{App, HttpServer};// web server
useactix_session::{SessionMiddleware,storage::CookieSessionStore,config::CookieContentSecurity};// store auth info in browser cookies
useactix_web::cookie::{Key, SameSite};usedotenv::dotenv;// load .env file
#[actix_web::main]async fnmain()->std::io::Result<()>{dotenv().ok();HttpServer::new(move||{App::new().wrap(SessionMiddleware::builder(CookieSessionStore::default(),Key::generate()).cookie_content_security(CookieContentSecurity::Private).cookie_same_site(SameSite::Lax).build())}).bind(("127.0.0.1",8080))?.run().await
}