When creating a cookie (responses) the name is forced to be a strict HTTP "token" and value a HTTP "word". This is relaxed on parsing as browsers and JavaScripts have different formats.
Follows RFC2109 standard. Here are the differences between Netscape, RFC2109, and RFC2965:
http://wp.netscape.com/newsref/std/cookie_spec.html
Public Types | |
typedef restcgi::cookie_attrs | attrs_type |
cookie attrs type | |
Public Member Functions | |
cookie () | |
cookie (const http_token &name, const http_word &value, const attrs_type &attrs=attrs_type()) | |
Construct. | |
cookie (const std::string &name, const std::string &value, const attrs_type &attrs=attrs_type()) | |
bool | is_null () const |
Test if null. | |
const std::string & | name () const |
template<typename T> | |
T | value () const |
const attrs_type & | attrs () const |
Get attrs. | |
const std::string & | id () const |
std::ostream & | operator<< (std::ostream &os) const |
Stream out in HTTP header format. |
restcgi::cookie::cookie | ( | ) |
Construct null.
restcgi::cookie::cookie | ( | const std::string & | name, | |
const std::string & | value, | |||
const attrs_type & | attrs = attrs_type() | |||
) |
Construct.
std::invalid_argument | if name or value are not valid |
const std::string& restcgi::cookie::id | ( | ) | const [inline] |
Get id made up of name:domain:path.
const std::string& restcgi::cookie::name | ( | ) | const [inline] |
Get name.
T restcgi::cookie::value | ( | ) | const [inline] |
Get converted, unencoded value.
bad_request | on conversion error |