Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::net::http::Cookie Class Reference

Cookie class. More...

#include <Cookie.h>

Public Types

using Ptr = std::shared_ptr<Cookie>
 

Public Member Functions

 Cookie (const std::string &name) noexcept
 
 Cookie (const std::string &name, const std::string &value) noexcept
 
bool expired (uint64_t now) const
 
bool isSecure () const
 
void setSecure (bool secure)
 
bool isHttpOnly () const
 
void setHttpOnly (bool http_only)
 
uint64_t getMaxAge () const
 
void setMaxAge (uint64_t max_age)
 
uint64_t getExpires () const
 
void setExpires (uint64_t expires)
 
const std::string & getName () const
 
const std::string & getValue () const
 
void setValue (const std::string &value)
 
const std::string & getDomain () const
 
void setDomain (const std::string &domain)
 
const std::string & getPath () const
 
void setPath (const std::string &path)
 
void updateExpiresFrom (uint64_t now)
 

Private Attributes

bool secure = false
 
bool httpOnly = false
 
uint64_t maxAge = 0
 
uint64_t expires = 0
 
std::string name
 
std::string value
 
std::string domain
 
std::string path
 

Detailed Description

Cookie class.

Member Typedef Documentation

◆ Ptr

using sese::net::http::Cookie::Ptr = std::shared_ptr<Cookie>

Constructor & Destructor Documentation

◆ Cookie() [1/2]

Cookie::Cookie ( const std::string & name)
explicitnoexcept

◆ Cookie() [2/2]

Cookie::Cookie ( const std::string & name,
const std::string & value )
noexcept

Member Function Documentation

◆ expired()

bool Cookie::expired ( uint64_t now) const
nodiscard

References expires.

◆ getDomain()

const std::string & Cookie::getDomain ( ) const
nodiscard

References domain.

◆ getExpires()

uint64_t Cookie::getExpires ( ) const
nodiscard

References expires.

◆ getMaxAge()

uint64_t Cookie::getMaxAge ( ) const
nodiscard

References maxAge.

◆ getName()

const std::string & Cookie::getName ( ) const
nodiscard

References name.

◆ getPath()

const std::string & Cookie::getPath ( ) const
nodiscard

References path.

◆ getValue()

const std::string & Cookie::getValue ( ) const
nodiscard

References value.

◆ isHttpOnly()

bool Cookie::isHttpOnly ( ) const
nodiscard

References httpOnly.

◆ isSecure()

bool Cookie::isSecure ( ) const
nodiscard

References secure.

◆ setDomain()

void Cookie::setDomain ( const std::string & domain)

References domain.

◆ setExpires()

void Cookie::setExpires ( uint64_t expires)

References expires.

◆ setHttpOnly()

void Cookie::setHttpOnly ( bool http_only)

References httpOnly.

◆ setMaxAge()

void Cookie::setMaxAge ( uint64_t max_age)

References maxAge.

◆ setPath()

void Cookie::setPath ( const std::string & path)

References path.

◆ setSecure()

void Cookie::setSecure ( bool secure)

References secure.

◆ setValue()

void Cookie::setValue ( const std::string & value)

References value.

◆ updateExpiresFrom()

void Cookie::updateExpiresFrom ( uint64_t now)

References expires, and maxAge.

Member Data Documentation

◆ domain

std::string sese::net::http::Cookie::domain
private

Referenced by getDomain(), and setDomain().

◆ expires

uint64_t sese::net::http::Cookie::expires = 0
private

◆ httpOnly

bool sese::net::http::Cookie::httpOnly = false
private

Referenced by isHttpOnly(), and setHttpOnly().

◆ maxAge

uint64_t sese::net::http::Cookie::maxAge = 0
private

◆ name

std::string sese::net::http::Cookie::name
private

Referenced by getName().

◆ path

std::string sese::net::http::Cookie::path
private

Referenced by getPath(), and setPath().

◆ secure

bool sese::net::http::Cookie::secure = false
private

Referenced by isSecure(), and setSecure().

◆ value

std::string sese::net::http::Cookie::value
private

Referenced by getValue(), and setValue().


The documentation for this class was generated from the following files: