20 releases

Uses old Rust 2015

0.4.0 Jul 27, 2016
0.3.0 Mar 25, 2016
0.2.17 Mar 24, 2016
0.2.16 Nov 28, 2015
0.1.3 Sep 16, 2015

#4 in #unmaintained

Download history 2/week @ 2024-02-18 28/week @ 2024-02-25 8/week @ 2024-03-03 14/week @ 2024-03-10 6/week @ 2024-03-17

56 downloads per month
Used in 3 crates

MIT license

5KB
94 lines

oven

simple cookie middleware for Iron


extern crate cookie;
extern crate oven;

use oven::prelude::*;

fn initialize_my_webapp_pls() {
  // do some things, make an iron::Chain...
  chain.link(oven::new(SUPER_SECRET_KEYS_THAT_LETS_BE_HONEST_YOULL_PROBABLY_ACCIDENTALLY_PUT_IN_GITHUB));
}

fn handle_some_requests(req: &mut Request) {
  let foocookie = req.get_cookie("foo"); // foo = Option<cookie::Cookie>
  // clients can't tamper with foo- it's signed when set and verified when loaded.
  // invalid signatures are equivalent to the cookie not existing.
  let mut resp = Response::new();
  resp.set_cookie(cookie::Cookie::new("foo", "new and interesting value of foo!"));
}

Dependencies

~5.5MB
~128K SLoC