summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-04-11 11:14:19 -0400
committerAndreas Kling <kling@serenityos.org>2021-04-11 18:24:34 +0200
commit4152f807bcb9a67cb6cf0bddcb9bdc4bd9b23a20 (patch)
treebad8e5cc505c42bb68a09ede41849eba578babaf /Userland/Libraries/LibWeb
parent1ef48d50ff9b6adeb13186799555ff11d6c7af9d (diff)
downloadserenity-4152f807bcb9a67cb6cf0bddcb9bdc4bd9b23a20.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/Loader/FrameLoader.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp
index ac39ef1b7f..19f1f0b369 100644
--- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp
+++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp
@@ -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());