Malloy
Loading...
Searching...
No Matches
cookie.hpp
1#pragma once
2
3#include <chrono>
4#include <filesystem>
5#include <string>
6
7namespace malloy::http
8{
9
18 class cookie
19 {
20 public:
21 enum class same_site_t
22 {
23 strict,
24 lax,
25 none
26 };
27
28 std::string name;
29 std::string value;
30 std::chrono::seconds max_age{ 0 };
31 std::string expires;
32 std::string domain;
33 std::filesystem::path path;
34 bool secure = true;
35 bool http_only = true;
36 same_site_t same_site = same_site_t::strict;
37
38 [[nodiscard]]
39 std::string to_string() const;
40 };
41
48 public cookie
49 {
50 public:
51 explicit
52 cookie_clear(const std::string& name_)
53 {
54 name = name_;
55 expires = m_expired_date;
56 }
57
58 private:
59 static constexpr const char* m_expired_date = "Thu, 01 Jan 1970 00:00:00 GMT";
60 };
61
62}
Definition: cookie.hpp:49
Definition: cookie.hpp:19
Definition: cookie.hpp:8