1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::Net::HTTPCookie</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1>
<h1 class="symbol">class HTTPCookie</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Net<br />
<b>Package:</b> HTTP<br />
<b>Header:</b> Poco/Net/HTTPCookie.h</p>
<h2>Description</h2>
<div class="description">
<p>This class represents a HTTP Cookie. </p>
<p>A cookie is a small amount of information sent by a Web server to a Web browser, saved by the browser, and later sent back to the server. A cookie's value can uniquely identify a client, so cookies are commonly used for session management. </p>
<p>A cookie has a name, a single value, and optional attributes such as a comment, path and domain qualifiers, a maximum age, and a version number. </p>
<p>This class supports both the Version 0 (by Netscape) and Version 1 (by <a href="http://www.ietf.org/rfc/rfc2109.txt" target="_blank">RFC 2109</a>) cookie specifications. By default, cookies are created using Version 0 to ensure the best interoperability. </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.HTTPCookie.html#12642" title="Poco::Net::HTTPCookie::getComment()">getComment</a>, <a href="Poco.Net.HTTPCookie.html#12645" title="Poco::Net::HTTPCookie::getDomain()">getDomain</a>, <a href="Poco.Net.HTTPCookie.html#12657" title="Poco::Net::HTTPCookie::getHttpOnly()">getHttpOnly</a>, <a href="Poco.Net.HTTPCookie.html#12654" title="Poco::Net::HTTPCookie::getMaxAge()">getMaxAge</a>, <a href="Poco.Net.HTTPCookie.html#12636" title="Poco::Net::HTTPCookie::getName()">getName</a>, <a href="Poco.Net.HTTPCookie.html#12648" title="Poco::Net::HTTPCookie::getPath()">getPath</a>, <a href="Poco.Net.HTTPCookie.html#12651" title="Poco::Net::HTTPCookie::getSecure()">getSecure</a>, <a href="Poco.Net.HTTPCookie.html#12639" title="Poco::Net::HTTPCookie::getValue()">getValue</a>, <a href="Poco.Net.HTTPCookie.html#12633" title="Poco::Net::HTTPCookie::getVersion()">getVersion</a>, <a href="Poco.Net.HTTPCookie.html#12629" title="Poco::Net::HTTPCookie::operator =()">operator =</a>, <a href="Poco.Net.HTTPCookie.html#12640" title="Poco::Net::HTTPCookie::setComment()">setComment</a>, <a href="Poco.Net.HTTPCookie.html#12643" title="Poco::Net::HTTPCookie::setDomain()">setDomain</a>, <a href="Poco.Net.HTTPCookie.html#12655" title="Poco::Net::HTTPCookie::setHttpOnly()">setHttpOnly</a>, <a href="Poco.Net.HTTPCookie.html#12652" title="Poco::Net::HTTPCookie::setMaxAge()">setMaxAge</a>, <a href="Poco.Net.HTTPCookie.html#12634" title="Poco::Net::HTTPCookie::setName()">setName</a>, <a href="Poco.Net.HTTPCookie.html#12646" title="Poco::Net::HTTPCookie::setPath()">setPath</a>, <a href="Poco.Net.HTTPCookie.html#12649" title="Poco::Net::HTTPCookie::setSecure()">setSecure</a>, <a href="Poco.Net.HTTPCookie.html#12637" title="Poco::Net::HTTPCookie::setValue()">setValue</a>, <a href="Poco.Net.HTTPCookie.html#12631" title="Poco::Net::HTTPCookie::setVersion()">setVersion</a>, <a href="Poco.Net.HTTPCookie.html#12658" title="Poco::Net::HTTPCookie::toString()">toString</a></p>
<h2>Constructors</h2>
<h3><a name="12618">HTTPCookie</a></h3>
<p class="decl"><a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a>();</p>
<div class="description">
<p>Creates an empty <a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a>. </p>
</div>
<h3><a name="12619">HTTPCookie</a></h3>
<p class="decl">explicit <a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a>(<br /> const std::string & name<br />);</p>
<div class="description">
<p>Creates a cookie with the given name. The cookie never expires. </p>
</div>
<h3><a name="12621">HTTPCookie</a></h3>
<p class="decl">explicit <a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a>(<br /> const <a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a> & nvc<br />);</p>
<div class="description">
<p>Creates a cookie from the given <a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a>. </p>
</div>
<h3><a name="12626">HTTPCookie</a></h3>
<p class="decl"><a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a>(<br /> const <a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a> & cookie<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a> by copying another one. </p>
</div>
<h3><a name="12623">HTTPCookie</a></h3>
<p class="decl"><a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a>(<br /> const std::string & name,<br /> const std::string & value<br />);</p>
<div class="description">
<p>Creates a cookie with the given name and value. The cookie never expires. </p>
</div>
<h2>Destructor</h2>
<h3><a name="12628">~HTTPCookie</a></h3>
<p class="decl">~<a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="12642">getComment</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & getComment() const;</p>
<div class="description">
<p>Returns the comment for the cookie. </p>
</div>
<h3><a name="12645">getDomain</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & getDomain() const;</p>
<div class="description">
<p>Returns the domain for the cookie. </p>
</div>
<h3><a name="12657">getHttpOnly</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getHttpOnly() const;</p>
<div class="description">
<p>Returns true if and only if the cookie's HttpOnly flag is set. </p>
</div>
<h3><a name="12654">getMaxAge</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int getMaxAge() const;</p>
<div class="description">
<p>Returns the maximum age in seconds for the cookie. </p>
</div>
<h3><a name="12636">getName</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & getName() const;</p>
<div class="description">
<p>Returns the name of the cookie. </p>
</div>
<h3><a name="12648">getPath</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & getPath() const;</p>
<div class="description">
<p>Returns the path for the cookie. </p>
</div>
<h3><a name="12651">getSecure</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getSecure() const;</p>
<div class="description">
<p>Returns the value of the secure flag for the cookie. </p>
</div>
<h3><a name="12639">getValue</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & getValue() const;</p>
<div class="description">
<p>Returns the value of the cookie. </p>
</div>
<h3><a name="12633">getVersion</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int getVersion() const;</p>
<div class="description">
<p>Returns the version of the cookie, which is either 0 or 1. </p>
</div>
<h3><a name="12629">operator =</a></h3>
<p class="decl"><a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a> & operator = (<br /> const <a href="Poco.Net.HTTPCookie.html" title="class Poco::Net::HTTPCookie">HTTPCookie</a> & cookie<br />);</p>
<div class="description">
<p>Assigns a cookie. </p>
</div>
<h3><a name="12640">setComment</a></h3>
<p class="decl">void setComment(<br /> const std::string & comment<br />);</p>
<div class="description">
<p>Sets the comment for the cookie. </p>
<p>Comments are only supported for version 1 cookies. </p>
</div>
<h3><a name="12643">setDomain</a></h3>
<p class="decl">void setDomain(<br /> const std::string & domain<br />);</p>
<div class="description">
<p>Sets the domain for the cookie. </p>
</div>
<h3><a name="12655">setHttpOnly</a></h3>
<p class="decl">void setHttpOnly(<br /> bool flag = true<br />);</p>
<div class="description">
<p>Sets the HttpOnly flag for the cookie. </p>
</div>
<h3><a name="12652">setMaxAge</a></h3>
<p class="decl">void setMaxAge(<br /> int maxAge<br />);</p>
<div class="description">
<p>Sets the maximum age in seconds for the cookie. </p>
<p>A value of -1 causes the cookie to never expire on the client. </p>
<p>A value of 0 deletes the cookie on the client. </p>
</div>
<h3><a name="12634">setName</a></h3>
<p class="decl">void setName(<br /> const std::string & name<br />);</p>
<div class="description">
<p>Sets the name of the cookie. </p>
</div>
<h3><a name="12646">setPath</a></h3>
<p class="decl">void setPath(<br /> const std::string & path<br />);</p>
<div class="description">
<p>Sets the path for the cookie. </p>
</div>
<h3><a name="12649">setSecure</a></h3>
<p class="decl">void setSecure(<br /> bool secure<br />);</p>
<div class="description">
<p>Sets the value of the secure flag for the cookie. </p>
</div>
<h3><a name="12637">setValue</a></h3>
<p class="decl">void setValue(<br /> const std::string & value<br />);</p>
<div class="description">
<p>Sets the value of the cookie. </p>
<p>According to the cookie specification, the size of the value should not exceed 4 Kbytes. </p>
</div>
<h3><a name="12631">setVersion</a></h3>
<p class="decl">void setVersion(<br /> int version<br />);</p>
<div class="description">
<p>Sets the version of the cookie. </p>
<p>Version must be either 0 (denoting a Netscape cookie) or 1 (denoting a <a href="http://www.ietf.org/rfc/rfc2109.txt" target="_blank">RFC 2109</a> cookie). </p>
</div>
<h3><a name="12658">toString</a></h3>
<p class="decl">std::string toString() const;</p>
<div class="description">
<p>Returns a string representation of the cookie, suitable for use in a Set-Cookie header. </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>
</div>
</body>
</html>
|