PrivateCookieJar
type PrivateCookieJar = PrivateCookieJar
A child cookie jar that provides authenticated encryption for its cookies.
[src]
pub fn add(self, cookie: Cookie) {
(self as _PrivateCookieJar).add(cookie as _Cookie);
}
Adds cookie to the parent jar. The cookie’s value is encrypted with
authenticated encryption assuring confidentiality, integrity, and
authenticity.
[src]
pub fn add(self, cookie: Cookie) {
(self as _PrivateCookieJar).add(cookie as _Cookie);
}
Adds cookie to the parent jar. The cookie’s value is encrypted with authenticated encryption assuring confidentiality, integrity, and authenticity.
Adds cookie to the parent jar. The cookie’s value is encrypted with authenticated encryption assuring confidentiality, integrity, and authenticity.
Example
use std.net.http.{Cookie, CookieKey, CookieJar};
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
let key = CookieKey.generate();
let private = cookie_jar.private_with_key(key);
let cookie = Cookie.new_with_string("foo", "bar");
private.add(cookie);
assert_eq private.get("foo")?.value(), "bar";
[src]
pub fn remove(self, name: string) {
(self as _PrivateCookieJar).remove(name);
}
Removes cookie from the parent jar.
[src]
pub fn remove(self, name: string) {
(self as _PrivateCookieJar).remove(name);
}
Removes cookie from the parent jar.
Removes cookie from the parent jar.
Example
use std.net.http.{Cookie, CookieKey, CookieJar};
let cookie_key = CookieKey.generate();
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
cookie_jar.set_key(cookie_key);
let private = cookie_jar.private();
private.remove("sessionId");
assert private.get("sessionId").is_nil();
[src]
pub fn get(self, name: string): Cookie? {
if (let cookie = (self as _PrivateCookieJar).get(name)) {
return cookie as Cookie;
} else {
return nil;
}
}
Returns cookie inside this jar with the name and authenticates and
decrypts the cookie’s value, returning a Cookie with the decrypted
value. If the cookie cannot be found, or the cookie fails to
authenticate or decrypt, None is returned.
[src]
pub fn get(self, name: string): Cookie? {
if (let cookie = (self as _PrivateCookieJar).get(name)) {
return cookie as Cookie;
} else {
return nil;
}
}
Returns cookie inside this jar with the name and authenticates and decrypts the cookie’s value, returning a Cookie with the decrypted value. If the cookie cannot be found, or the cookie fails to authenticate or decrypt, None is returned.
Returns cookie inside this jar with the name and authenticates and decrypts the cookie’s value, returning a Cookie with the decrypted value. If the cookie cannot be found, or the cookie fails to authenticate or decrypt, None is returned.
Example
use std.net.http.{Cookie, CookieKey, CookieJar};
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
let key = CookieKey.generate();
let private = cookie_jar.private_with_key(key);
assert_eq private.get("sessionId")?.value(), nil;