cookiebox-0.2.0 has been yanked.
Cookiebox
A strongly typed cookie management crate for the Actix Web framework.
cookiebox provides a robust, type-safe, and flexible approach to managing cookies in Actix web based applications. It allows you to define, configure, and retrieve cookies with minimal boilerplate.
Features
- This crate uses biscotti under the hood which inherit most of it's features.
- Supports custom configuration settings per cookie
- Define specific types for deserializing cookie values during retrieval
- Customize data type and serialization method for each cookie.
- A Simple and type safe interface for retrieving, adding, removing cookies.
Usage
To start using the cookiebox crate in your web application you must register [CookieMiddleware] in your App.
use ;
use ;
async
Now, define the desired typed cookies with custom configuration
use cookie;
use ;
use ;
use Storage;
use ;
use ;
use json;
// Define you cookie type struct
;
// IncomingConfig give the cookie type get and get_all cookie with similar name
// You may opt out if don't want read cookie data
// OutgoingConfig give the cookie type insert and remove cookie
// You may opt out if don't want insert or remove a cookie
// Add all cookies in cookie collection
;
//Once defined, your cookies can be accessed in request handlers by implementing `FromRequest` for a collection
//of typed cookies.