Cookie
Cookie setting/parsing middleware for the Iron framework.
Install / Use
/learn @iron-graveyard/CookieREADME
cookie 
Cookie parsing and setting middleware for the Iron web framework.
Example
fn main() {
let mut server: Server = Iron::new();
server.chain.link(CookieParser::new());
server.chain.link(FromFn::new(echo_cookies));
server.listen(::std::io::net::ip::Ipv4Addr(127, 0, 0, 1), 3000);
}
fn echo_cookies(req: &mut Request, _: &mut Response) -> Status {
let cookie = req.alloy.find::<Cookie>().unwrap();
for (key, value) in cookie.map.iter() {
println!("{}:\t{}", *key, *value)
}
Continue
}
Overview
cookie is a part of Iron's core bundle.
- Set and parse cookies from the browser
- Use signed cookies (using an HMAC)
- Use JSON cookies
Installation
If you're using a Cargo.toml to manage dependencies, just add cookie to the toml:
[dependencies.cookie]
git = "https://github.com/iron/cookie.git"
Otherwise, cargo build, and the rlib will be in your target directory.
Documentation
Along with the online documentation,
you can build a local copy with cargo doc.
Examples
Get Help
One of us (@reem, @zzmp,
@theptrk, @mcreinhard)
is usually on #iron on the mozilla irc. Come say hi and ask any questions you might have.
We are also usually on #rust and #rust-webdev.
Related Skills
node-connect
354.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
