|
magpie
|
#include <Cookie.hpp>
Public Member Functions | |
| Cookie (std::string &&name, std::string &&value) | |
| const std::string & | getName () const |
| const std::string & | getValue () const |
| const std::optional< size_t > & | getMaxAge () const |
| bool | isHttpOnly () const |
| bool | isSecure () const |
| Cookie & | setHttpOnly () |
| Cookie & | setSecure () |
| Cookie & | setPath (std::string &&path) |
| Cookie & | setDomain (const std::string &domain) |
Used to represent both inbound and outbound cookies in a parsed format. When constructing a cookie in code, there's several builder functions that can be used to set other options.
| magpie::Cookie::Cookie | ( | std::string && | name, |
| std::string && | value ) |
Constructs a cookie.
| name | The name of the cookie |
| value | The value stored in the cookie |
| maxAge | The max age of the cookie represented as seconds. If nullopt, no MaxAge is set. |
| Cookie & magpie::Cookie::setHttpOnly | ( | ) |
Call this to set the HttpOnly flag in the cookie.
| Cookie & magpie::Cookie::setSecure | ( | ) |
Call this to set the Secure flag in the cookie.