http_cookie.h
//
// Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
//
// See accompanying file COPYING.TXT file for licensing details.
//
#ifndef CPPCMS_HTTP_COOKIE_H
#define CPPCMS_HTTP_COOKIE_H
#include <cppcms/defs.h>
#include <booster/copy_ptr.h>
#include <string>
#include <iostream>
#include <cppcms/cstdint.h>
namespace cppcms { namespace http {
class cookie;
std::ostream CPPCMS_API &operator<<(std::ostream &,cookie const &);
class CPPCMS_API cookie {
public:
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 expires(time_t when);
void max_age(unsigned a);
void browser_age();
void secure(bool v);
bool empty() const;
cookie();
~cookie();
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());
private:
friend std::ostream &operator<<(std::ostream &,cookie const &);
void write(std::ostream &) const;
// for future use
struct _data;
booster::copy_ptr<_data> d;
// real members
std::string name_;
std::string value_;
std::string path_;
std::string domain_;
std::string comment_;
unsigned max_age_;
uint32_t secure_ : 1;
uint32_t has_age_ : 1;
uint32_t has_expiration_: 1;
uint32_t reserved_ : 29;
};
} } //::cppcms::http
#endif
booster::locale::as::domain
details::set_domain domain(std::string const &id)
Definition: message.h:789
booster::locale::operator<<
std::basic_ostream< CharType > & operator<<(std::basic_ostream< CharType > &out, date_time const &t)
Definition: date_time.h:874
booster::copy_ptr< _data >
cppcms::http::cookie
Class that represents single HTTP Cookie Generally used in context of http::request and http::respons...
Definition: http_cookie.h:27