Main Page   Compound List   Compound Members  

cgixx::cookie Class Reference

#include <cookie.h>

List of all members.

Public Methods

 cookie (const cgi &initcgi, const std::string &name, const std::string &value="")
 cookie (const std::string &name, const std::string &value="")
 cookie (const cookie &copy)
 ~cookie ()
void setvalue (const std::string &value)
void setdomain (const std::string &domain)
void setpath (const std::string &path)
bool setexpire (const std::string &expire)
void setsecure (bool requiressl)
const std::string & getname () const
const std::string & getvalue () const
std::string get ()


Detailed Description

The cookie class is a helper class for the header class that is only required if cookies will be used.

Author:
Isaac W. Foraker


Constructor & Destructor Documentation

cgixx::cookie::cookie const cgi   initcgi,
const std::string &    name,
const std::string &    value = ""
 

Construct a cookie on a cgi session. The cgi session will be used to prepopulate domain and path.

Parameters:
initcgi  Reference to cgi instance.
name  Name of this cookie.
value  Value of this cookie.

cgixx::cookie::cookie const std::string &    name,
const std::string &    value = ""
 

Construct a basic cookie.

Parameters:
name  Name of this cookie.
value  Value of this cookie.

cgixx::cookie::cookie const cookie &    copy
 

Construct a copy of another cookie.

Parameters:
copy  Reference to cookie to copy.

cgixx::cookie::~cookie  
 

Destroy *this instance of cookie.


Member Function Documentation

std::string cgixx::cookie::get  
 

Get the formatted cookie header of the form:

Set-Cookie: NAME=VALUE; expire=DATE; path=PATH; domain=DOMAIN_NAME; secure

Parameters:
none 
Returns:
The formatted cookie header.

const std::string & cgixx::cookie::getname   const
 

Get the name of this cookie.

Parameters:
none 
Returns:
The name of this cookie.

const std::string & cgixx::cookie::getvalue   const
 

Get the value of this cookie.

Parameters:
none 
Returns:
The value of this cookie.

void cgixx::cookie::setdomain const std::string &    domain
 

The the domain of this cookie.

Parameters:
domain  Domain for this cookie.
Returns:
nothing

bool cgixx::cookie::setexpire const std::string &    expire
 

Set the expiration date and time for this cookie.

Parameters:
expire  The expire parameter my be either the RFC 850 encoded date of expiration, or an offset string containing "(-)123(M|H|S|D|W|m|Y)". I.e. a number (negative numbers generally cause the document to expire immediately) followed by a time modifier. M=minute, H=hour, S=second, D=day, W=week, m=month, Y=year.
Returns:
false if the offset was successfully parsed into a date; true if the the expire string was accepted as is.

void cgixx::cookie::setpath const std::string &    path
 

Set the path of this cookie.

Parameters:
path  Path for this cookie.
Returns:
nothing

void cgixx::cookie::setsecure bool    requiressl
 

Specify whether this cookie requires an ssl connection in order for the client to transmit this cookie.

Parameters:
requiressl  When true, require ssl.
Returns:
nothing

void cgixx::cookie::setvalue const std::string &    value
 

Set the value of this cookie.

Parameters:
value  Value for this cookie.
Returns:
nothing


The documentation for this class was generated from the following files:
Generated on Mon May 13 21:12:33 2002 for cgixx by doxygen1.2.13 written by Dimitri van Heesch, © 1997-2001