Molybden API
Loading...
Searching...
No Matches
molybden::Cookie Struct Reference

An HTTP cookie. More...

#include <cookie.hpp>

Public Member Functions

 Cookie (std::string domain, std::string name="", std::string value="", std::string path="/", bool is_secure=false, bool is_http_only=false, Timestamp creation_time=time::now().time_since_epoch().count(), Timestamp expiration_time=0, SameSite same_site=SameSite::kLaxMode)
 

Public Attributes

std::string domain
 The domain name of this cookie.
 
std::string name
 The name of this cookie.
 
std::string value
 The value of this cookie or an empty string if the cookie value is not specified.
 
std::string path = "/"
 The path that must exist in the URL of a request in order to send this cookie to the server.
 
bool is_secure
 Indicates if the cookie is restricted to a secure protocol (HTTPS or WSS) or false if it can be sent using any protocol.
 
bool is_http_only
 Indicates if the cookie is considered HTTP only.
 
Timestamp creation_time
 The cookie creation time since UNIX epoch.
 
Timestamp expiration_time
 The cookie expiration time since UNIX epoch.
 
SameSite same_site
 The SameSite cookie attribute value.
 

Detailed Description

An HTTP cookie.

Member Data Documentation

◆ creation_time

Timestamp molybden::Cookie::creation_time

The cookie creation time since UNIX epoch.

The returned value equals the number of milliseconds since January 1, 1970.

When instantiating the Cookie object, it is the time of the instantiation.

◆ domain

std::string molybden::Cookie::domain

The domain name of this cookie.

Please note, that the domain is also required for cookies with __Host prefix.

◆ expiration_time

Timestamp molybden::Cookie::expiration_time

The cookie expiration time since UNIX epoch.

The returned value equals the number of milliseconds since January 1, 1970. Returns 0 for session cookies.

When instantiating the Cookie object, it is one minute after the instantiation.

◆ is_http_only

bool molybden::Cookie::is_http_only

Indicates if the cookie is considered HTTP only.

It means that the cookie contains the HttpOnly attribute and should not be accessible from JavaScript.


The documentation for this struct was generated from the following file: