CppCMS
Public Member Functions | Friends
cppcms::http::cookie Class Reference

Class that represents single HTTP Cookie Generally used in context of http::request and http::response. More...

#include <cppcms/http_cookie.h>

List of all members.

Public Member Functions

std::string name () const
std::string value () const
std::string path () const
std::string domain () const
std::string comment () const
bool secure () const
void name (std::string n)
void value (std::string v)
void path (std::string p)
void domain (std::string)
void comment (std::string)
void max_age (unsigned a)
void browser_age ()
void secure (bool v)
bool empty () const
 cookie (cookie const &)
cookie const & operator= (cookie const &)
 cookie (std::string name, std::string value)
 cookie (std::string name, std::string value, unsigned age)
 cookie (std::string name, std::string value, unsigned age, std::string path, std::string domain=std::string(), std::string comment=std::string())
 cookie (std::string name, std::string value, std::string path, std::string domain=std::string(), std::string comment=std::string())

Friends

std::ostream & operator<< (std::ostream &, cookie const &)

Detailed Description

Class that represents single HTTP Cookie Generally used in context of http::request and http::response.


Constructor & Destructor Documentation

cppcms::http::cookie::cookie ( std::string  name,
std::string  value 
)

Create cookie with name and value, age - browser, rest properties undefined.

cppcms::http::cookie::cookie ( std::string  name,
std::string  value,
unsigned  age 
)

Create cookies with name, value and max-age, rest properties undefined.

cppcms::http::cookie::cookie ( std::string  name,
std::string  value,
unsigned  age,
std::string  path,
std::string  domain = std::string(),
std::string  comment = std::string() 
)

Create cookie with name, value, max-age, path, domain and command

cppcms::http::cookie::cookie ( std::string  name,
std::string  value,
std::string  path,
std::string  domain = std::string(),
std::string  comment = std::string() 
)

Create cookie with name, value, path, domain and comment, age - browser.


Member Function Documentation

Set age according to browser's session (i.e. no Max-Age)

std::string cppcms::http::cookie::comment ( ) const

Cookie's comment

void cppcms::http::cookie::comment ( std::string  )

Set cookie's comment

std::string cppcms::http::cookie::domain ( ) const

Cookie's domain

void cppcms::http::cookie::domain ( std::string  )

Set cookie's domain

Check if cookie is not assigned - empty

void cppcms::http::cookie::max_age ( unsigned  a)

Set max cookie's age

std::string cppcms::http::cookie::name ( ) const

Cookie's Name

void cppcms::http::cookie::name ( std::string  n)

Set cookie's name

std::string cppcms::http::cookie::path ( ) const

Cookie's path

void cppcms::http::cookie::path ( std::string  p)

Set cookie's path

Check if the cookie is transferred over secure connection only

void cppcms::http::cookie::secure ( bool  v)

Set secure property on the cookies

std::string cppcms::http::cookie::value ( ) const

Cookie's value

void cppcms::http::cookie::value ( std::string  v)

Set cookie's value


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