MCPcopy Create free account
hub / github.com/PerroEngine/Perro / load_cookie_value

Function load_cookie_value

perro_source/api_modules/perro_web/src/storage.rs:164–176  ·  view source on GitHub ↗
(key: &str)

Source from the content-addressed store, hash-verified

162
163#[cfg(target_arch = "wasm32")]
164fn load_cookie_value(key: &str) -> io::Result<Option<String>> {
165 let all = document()?.cookie().map_err(js_err)?;
166 for pair in all.split(';') {
167 let trimmed = pair.trim();
168 let Some((name, value)) = trimmed.split_once('=') else {
169 continue;
170 };
171 if name == key {
172 return cookie_decode(value).map(Some);
173 }
174 }
175 Ok(None)
176}
177
178#[cfg(target_arch = "wasm32")]
179fn save_cookie_value(key: &str, value: &str) -> io::Result<()> {

Callers 1

load_bytes_implFunction · 0.85

Calls 2

documentFunction · 0.85
cookie_decodeFunction · 0.85

Tested by

no test coverage detected