summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/CookieJar.cpp
diff options
context:
space:
mode:
authorRafał Babiarz <5783815+Sauler@users.noreply.github.com>2022-03-01 17:05:42 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-02 18:11:17 +0100
commit5f5ee2020e4a58d01b4bc47f3dfdc6ba44dda75b (patch)
tree27f9ddbf9f55ba4cd1295fab35b4beaf06b792ea /Userland/Applications/Browser/CookieJar.cpp
parent81c042a8cd1596b6fb767bcf2bc507a3bceacd41 (diff)
downloadserenity-5f5ee2020e4a58d01b4bc47f3dfdc6ba44dda75b.zip
Browser: Add method to get cookies list
Diffstat (limited to 'Userland/Applications/Browser/CookieJar.cpp')
-rw-r--r--Userland/Applications/Browser/CookieJar.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/CookieJar.cpp b/Userland/Applications/Browser/CookieJar.cpp
index cb65e7963d..119dc9e1ab 100644
--- a/Userland/Applications/Browser/CookieJar.cpp
+++ b/Userland/Applications/Browser/CookieJar.cpp
@@ -75,6 +75,17 @@ void CookieJar::dump_cookies() const
dbgln("{}", builder.build());
}
+Vector<Web::Cookie::Cookie> CookieJar::get_all_cookies() const
+{
+ Vector<Web::Cookie::Cookie> cookies;
+ cookies.ensure_capacity(m_cookies.size());
+
+ for (auto const& cookie : m_cookies)
+ cookies.unchecked_append(cookie.value);
+
+ return cookies;
+}
+
Optional<String> CookieJar::canonicalize_domain(const URL& url)
{
// https://tools.ietf.org/html/rfc6265#section-5.1.2