Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Session
✓ use actix_session::Session;
Basic session counter example
use actix_session::Session;
use actix_web::{web, App, HttpServer, HttpResponse};
async fn index(session: Session) -> HttpResponse {
let count: i32 = session.get("count").unwrap().unwrap_or(0);
session.insert("count", count + 1).unwrap();
HttpResponse::Ok().body(format!("Count: {}", count))
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.route("/", web::get().to(index))
})
.bind("127.0.0.1:8080")?
.run()
.await
}
Upgrade
Version history
0.11.0latest on crates.io
Audit
Dependencies
No dependency data recorded yet.