2021-04-13 16:47:05 -04:00
|
|
|
/*
|
2022-01-31 13:07:22 -05:00
|
|
|
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
2021-04-13 16:47:05 -04:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-04-13 16:47:05 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Optional.h>
|
|
|
|
#include <AK/String.h>
|
|
|
|
#include <LibCore/DateTime.h>
|
2021-04-15 10:36:20 -04:00
|
|
|
#include <LibIPC/Forward.h>
|
2021-04-13 16:47:05 -04:00
|
|
|
|
|
|
|
namespace Web::Cookie {
|
|
|
|
|
|
|
|
struct ParsedCookie {
|
|
|
|
String name;
|
|
|
|
String value;
|
|
|
|
Optional<Core::DateTime> expiry_time_from_expires_attribute {};
|
|
|
|
Optional<Core::DateTime> expiry_time_from_max_age_attribute {};
|
|
|
|
Optional<String> domain {};
|
|
|
|
Optional<String> path {};
|
|
|
|
bool secure_attribute_present { false };
|
|
|
|
bool http_only_attribute_present { false };
|
|
|
|
};
|
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
Optional<ParsedCookie> parse_cookie(String const& cookie_string);
|
2021-04-13 16:47:05 -04:00
|
|
|
|
|
|
|
}
|
2021-04-15 10:36:20 -04:00
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
2022-04-03 15:44:25 +03:00
|
|
|
bool encode(Encoder&, Web::Cookie::ParsedCookie const&);
|
|
|
|
ErrorOr<void> decode(Decoder&, Web::Cookie::ParsedCookie&);
|
2021-04-15 10:36:20 -04:00
|
|
|
|
|
|
|
}
|