#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CookieSameSiteOptions {
Strict,
Lax,
None,
}
#[derive(Debug, Clone, PartialEq)]
pub struct CookieOptions {
pub http_only: bool,
pub secure: bool,
pub same_site: CookieSameSiteOptions,
pub path: Option<&'static str>,
pub domain: Option<&'static str>,
pub max_age: Option<i64>,
pub expires: Option<i64>,
}
impl Default for CookieOptions {
fn default() -> Self {
Self {
http_only: true,
secure: true,
same_site: CookieSameSiteOptions::None,
path: Some("/"),
domain: None,
max_age: None,
expires: None,
}
}
}
#[derive(Debug, PartialEq, Clone)]
pub(crate) enum Cookie {
AddCookie(AddCookie),
RemoveCookie(&'static str),
}
#[derive(Debug, Clone, PartialEq)]
pub(crate) struct AddCookie {
pub name: &'static str,
pub value: &'static str,
pub(crate) options: CookieOptions,
}