KDYHFAE3GPCISJYGND4OIPAHUJNPRPEERNJIEY7WSEUCR6IE7TJAC
ET46DDPXF35R4IGIAGI5KL5UAX67JA4TGCCMDEQFJ24DR3ODT3QAC
LWCZDLBI3HN4RF6BVQMW2S7DA3YYQXRDHAXKEFZTAH57WOQZAMPQC
S6MX4MFOHET5CZ4LEWCWZJ77K4CG34QCU77OQ4KNWJGD52UNDV4AC
WVHXYKCVPKAFVMXBEMD3IHG54RKOIDSOCVNR3OIPEZQG36IGYJZQC
EVP2FSBHQUCAXQ6IIMBD6IS24ODKHP6HFWYCHIMYG6KOFRQG3RVQC
HDHALX3UK5VSU7WBDWSVF37QG5OBCIOLFGP5PQTGBQFOARZOKWMQC
2MPJPGRYNR4BD4H6OS2PKQTFBBYQZSD5ISQ762VEJFDAE5MMXULQC
BKHQHXZQDFC6SSIQ3XBNIBYQJBD3EN6VFKK7VBWY4BOT2H2ZRQAAC
ZRU62WXDVY32ZF7AUYONXUQUAKZZGCUFWAYYBA32OXEBARVDVSNAC
4MZ4VIR7FU3PQ3WKJI6TJIKYOIIBODFEPKLMQ32S4AKPZSDFO6AQC
Z3SYSC25TVJBLI4JBYM3OCBK7DYCC2BKPAYW6OVTN2ILFQ4ANUMQC
BCXEUKX6RVE4UQE46ITSQY2NXYK3MJT7HHL7CJOM7T4OOOCADMIAC
pub async fn post_accept_cookies() -> HttpResponse {
HttpResponse::Found()
pub async fn post_accept_cookies(
request: HttpRequest,
data: web::Data<WebData<'_>>,
) -> HttpResponse {
let mut jar = request_to_jar(request);
let mut builder = cookie::Cookie::build("i_accept_cookie", "yes")
.path("/")
.secure(true)
.http_only(true)
.same_site(cookie::SameSite::Strict)
.max_age(cookie::time::Duration::weeks(4));
if data.set_cookie_domain {
builder = builder.domain(data.base_domain.to_string());
}
jar.private_mut(&data.cookies_key).add(builder.finish());
let mut response = HttpResponse::Found()
.finish()
.finish();
let mut builder = cookie::Cookie::build("i_accept_cookie", "").path("/");
if data.set_cookie_domain {
builder = builder.domain(data.base_domain.to_string());
}
if let Err(e) = response.add_removal_cookie(&builder.finish()) {
log::error!("Cann't set cookie {}", e);
}
let mut builder = cookie::Cookie::build("auth", "").path("/");
if data.set_cookie_domain {
builder = builder.domain(data.base_domain.to_string());
}
if let Err(e) = response.add_removal_cookie(&builder.finish()) {
log::error!("Cann't set cookie {}", e);
}
response