Request session extension for the Iron web framework.
session is a fast, convenient, and flexible extension for Iron Request. It allows saving/retriving data in to session, redis as the backend data repos.
```rust
extern crate iron; extern crate session; extern crate rustc_serialize; use iron::prelude::; use session::;
// To run, $ cargo run --example simple // to use, $ curl "http://localhost:3000"
fn main() { let mut chain = Chain::new(handler); let signingkey = "key-123456"; let expireseconds = 3600; let connectstr = "redis://localhost"; chain.around(session::Session::new(signingkey, expireseconds, connectstr)); Iron::new(chain).http("localhost:3000").unwrap(); }
fn handler(req: &mut Request) -> IronResult
```
If you're using cargo, just add session to your Cargo.toml
.
```toml [dependencies]
session = "*" ```
Otherwise, cargo build
, and the rlib will be in your target
directory.