1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

LibWeb: Store cookies sent via the Set-Cookie HTTP header

Note: HTTP response headers are currently stored in a hash map, so the
Set-Cookie entry will only appear once here.
This commit is contained in:
Timothy Flynn 2021-04-11 11:14:19 -04:00 committed by Andreas Kling
parent 1ef48d50ff
commit 4152f807bc

View file

@ -274,6 +274,11 @@ void FrameLoader::resource_did_load()
return;
}
// FIXME: Support multiple instances of the Set-Cookie response header.
auto set_cookie = resource()->response_headers().get("Set-Cookie");
if (set_cookie.has_value())
document->set_cookie(set_cookie.value());
if (!url.fragment().is_empty())
frame().scroll_to_anchor(url.fragment());