ClearSilver::Cookie::Expires Class Reference

HTTP cookie expiration time. More...

#include <Cookie.h>

List of all members.

Public Member Functions

std::string operator() () const
 Expiration time.
Constructors and assignment operators
 Expires ()
 Default constructor.
 Expires (const char *)
 Define the expiration time.
 Expires (const std::string &)
 Define the expiration time.
 Expires (time_t)
 Define the expiration time.
 Expires (struct tm)
 Define the expiration time.
 Expires (const boost::posix_time::ptime &)
 Define the expiration time.
 Expires (const Expires &)
 Copy constructor.
 ~Expires () throw ()
 Destructor.
Expiresoperator= (const Expires &)
 Assignment operator.
void swap (Expires &) throw ()
 Swap contents with another object.
Inspectors
 operator bool () const
 Is an expiration time defined?
bool empty () const
 Is the expiration time empty?


Detailed Description

HTTP cookie expiration time.

The HTTP cookie expiration time is one of the credentials associated with an HTTP cookie, which are described by the following reference.

The expires attribute specifies a date string that defines the valid life time of that cookie. Once the expiration date has been reached, the cookie will no longer be stored or given out. The date string is formatted as:

This is based on RFC 822, RFC 850, RFC 1036, and RFC 1123, with the variations that the only legal time zone is GMT and the separators between the elements of the date must be dashes.

expires is an optional attribute. If not specified, the cookie will expire when the user's session ends.

Note: There is a bug in Netscape Navigator version 1.1 and earlier. Only cookies whose path attribute is set explicitly to "/" will be properly saved between sessions if they have an expires attribute.

Definition at line 230 of file Cookie.h.


Constructor & Destructor Documentation

Cookie::Expires::Expires const char *   )  [explicit]
 

Define the expiration time.

This constructor converts a string reprentation of an expiration time into an internal forrm suitable for an HTTP cookie. The format of the string argument must follow the ISO standard, YYYY-MMM-DD HH:MM:SS, and is assumed to refer to a UTC time. The string argument is interpreted using the date_time library provided by Boost.

Definition at line 240 of file Cookie.cc.

ClearSilver::Cookie::Expires::Expires const std::string  )  [explicit]
 

Define the expiration time.

This constructor converts a string reprentation of an expiration time into an internal forrm suitable for an HTTP cookie. The format of the string argument must follow the ISO standard, YYYY-MMM-DD HH:MM:SS, and is assumed to refer to a UTC time. The string argument is interpreted using the date_time library provided by Boost.

Cookie::Expires::Expires const boost::posix_time::ptime &   )  [explicit]
 

Define the expiration time.

This constructor converts a Boost Posix time representation of an expiration time into an internal forrm suitable for an HTTP cookie. The Boost library provides complete date_time handling, so it should be easy to construct an Expires object based on date_time arithmetic.

Definition at line 251 of file Cookie.cc.


The documentation for this class was generated from the following files:
Generated on Tue May 16 14:50:54 2006 for ClearSilver C++ Library by  doxygen 1.4.5