Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 2083

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qnetworkcookie.cpp -->
  <title>QNetworkCookie Class | Qt Network 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtnetwork-index.html">Qt Network</a></td><td ><a href="qtnetwork-module.html">C++ Classes</a></td><td >QNetworkCookie</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtnetwork-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QNetworkCookie Class</h1>
<!-- $$$QNetworkCookie-brief -->
<p>The <a href="qnetworkcookie.html">QNetworkCookie</a> class holds one network cookie. <a href="#details">More...</a></p>
<!-- @@@QNetworkCookie -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QNetworkCookie&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += network</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.4</td></tr></table></div><ul>
<li><a href="qnetworkcookie-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#RawForm-enum">RawForm</a></b> { NameAndValueOnly, Full }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></b>(const QByteArray &amp;<i>name</i> = QByteArray(), const QByteArray &amp;<i>value</i> = QByteArray())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#QNetworkCookie-1">QNetworkCookie</a></b>(const QNetworkCookie &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#dtor.QNetworkCookie">~QNetworkCookie</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#domain">domain</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#expirationDate">expirationDate</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#hasSameIdentifier">hasSameIdentifier</a></b>(const QNetworkCookie &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#isHttpOnly">isHttpOnly</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#isSecure">isSecure</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#isSessionCookie">isSessionCookie</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#name">name</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#normalize">normalize</a></b>(const QUrl &amp;<i>url</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#path">path</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#setDomain">setDomain</a></b>(const QString &amp;<i>domain</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#setExpirationDate">setExpirationDate</a></b>(const QDateTime &amp;<i>date</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#setHttpOnly">setHttpOnly</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#setName">setName</a></b>(const QByteArray &amp;<i>cookieName</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#setPath">setPath</a></b>(const QString &amp;<i>path</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#setSecure">setSecure</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#setValue">setValue</a></b>(const QByteArray &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#swap">swap</a></b>(QNetworkCookie &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#toRawForm">toRawForm</a></b>(QNetworkCookie::RawForm <i>form</i> = Full) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#value">value</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#operator-not-eq">operator!=</a></b>(const QNetworkCookie &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkCookie &amp;</td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#operator-eq">operator=</a></b>(QNetworkCookie &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkCookie &amp;</td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#operator-eq-1">operator=</a></b>(const QNetworkCookie &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#operator-eq-eq">operator==</a></b>(const QNetworkCookie &amp;<i>other</i>) const</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QNetworkCookie&gt; </td><td class="memItemRight bottomAlign"><b><a href="qnetworkcookie.html#parseCookies">parseCookies</a></b>(const QByteArray &amp;<i>cookieString</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QNetworkCookie-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qnetworkcookie.html">QNetworkCookie</a> class holds one network cookie.</p>
<p>Cookies are small bits of information that stateless protocols like HTTP use to maintain some persistent information across requests.</p>
<p>A cookie is set by a remote server when it replies to a request and it expects the same cookie to be sent back when further requests are sent.</p>
<p><a href="qnetworkcookie.html">QNetworkCookie</a> holds one such cookie as received from the network. A cookie has a name and a value, but those are opaque to the application (that is, the information stored in them has no meaning to the application). A cookie has an associated path name and domain, which indicate when the cookie should be sent again to the server.</p>
<p>A cookie can also have an expiration date, indicating its validity. If the expiration date is not present, the cookie is considered a &quot;session cookie&quot; and should be discarded when the application exits (or when its concept of session is over).</p>
<p><a href="qnetworkcookie.html">QNetworkCookie</a> provides a way of parsing a cookie from the HTTP header format using the <a href="qnetworkcookie.html#parseCookies">QNetworkCookie::parseCookies</a>() function. However, when received in a <a href="qnetworkreply.html">QNetworkReply</a>, the cookie is already parsed.</p>
<p>This class implements cookies as described by the initial cookie specification by Netscape, which is somewhat similar to the <a href="http://www.rfc-editor.org/rfc/rfc2109.txt">RFC 2109</a> specification, plus the &quot;HttpOnly&quot; extension. The more recent <a href="http://www.rfc-editor.org/rfc/rfc2965.txt">RFC 2965</a> specification (which uses the Set-Cookie2 header) is not supported.</p>
</div>
<p><b>See also </b><a href="qnetworkcookiejar.html">QNetworkCookieJar</a>, <a href="qnetworkrequest.html">QNetworkRequest</a>, and <a href="qnetworkreply.html">QNetworkReply</a>.</p>
<!-- @@@QNetworkCookie -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$RawForm$$$NameAndValueOnly$$$Full -->
<h3 class="fn" id="RawForm-enum"><a name="RawForm-enum"></a>enum QNetworkCookie::<span class="name">RawForm</span></h3>
<p>This enum is used with the <a href="qnetworkcookie.html#toRawForm">toRawForm</a>() function to declare which form of a cookie shall be returned.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QNetworkCookie::NameAndValueOnly</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">makes <a href="qnetworkcookie.html#toRawForm">toRawForm</a>() return only the &quot;NAME=VALUE&quot; part of the cookie, as suitable for sending back to a server in a client request's &quot;Cookie:&quot; header. Multiple cookies are separated by a semi-colon in the &quot;Cookie:&quot; header field.</td></tr>
<tr><td class="topAlign"><code>QNetworkCookie::Full</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">makes <a href="qnetworkcookie.html#toRawForm">toRawForm</a>() return the full cookie contents, as suitable for sending to a client in a server's &quot;Set-Cookie:&quot; header.</td></tr>
</table></div>
<p>Note that only the Full form of the cookie can be parsed back into its original contents.</p>
<p><b>See also </b><a href="qnetworkcookie.html#toRawForm">toRawForm</a>() and <a href="qnetworkcookie.html#parseCookies">parseCookies</a>().</p>
<!-- @@@RawForm -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QNetworkCookie[overload1]$$$QNetworkCookieconstQByteArray&constQByteArray& -->
<h3 class="fn" id="QNetworkCookie"><a name="QNetworkCookie"></a>QNetworkCookie::<span class="name">QNetworkCookie</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &amp;<i>name</i> = QByteArray(), const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &amp;<i>value</i> = QByteArray())</h3>
<p>Create a new <a href="qnetworkcookie.html">QNetworkCookie</a> object, initializing the cookie name to <i>name</i> and its value to <i>value</i>.</p>
<p>A cookie is only valid if it has a name. However, the value is opaque to the application and being empty may have significance to the remote server.</p>
<!-- @@@QNetworkCookie -->
<!-- $$$QNetworkCookie$$$QNetworkCookieconstQNetworkCookie& -->
<h3 class="fn" id="QNetworkCookie-1"><a name="QNetworkCookie-1"></a>QNetworkCookie::<span class="name">QNetworkCookie</span>(const <span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span> &amp;<i>other</i>)</h3>
<p>Creates a new <a href="qnetworkcookie.html">QNetworkCookie</a> object by copying the contents of <i>other</i>.</p>
<!-- @@@QNetworkCookie -->
<!-- $$$~QNetworkCookie[overload1]$$$~QNetworkCookie -->
<h3 class="fn" id="dtor.QNetworkCookie"><a name="dtor.QNetworkCookie"></a>QNetworkCookie::<span class="name">~QNetworkCookie</span>()</h3>
<p>Destroys this <a href="qnetworkcookie.html">QNetworkCookie</a> object.</p>
<!-- @@@~QNetworkCookie -->
<!-- $$$domain[overload1]$$$domain -->
<h3 class="fn" id="domain"><a name="domain"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QNetworkCookie::<span class="name">domain</span>() const</h3>
<p>Returns the domain this cookie is associated with. This corresponds to the &quot;domain&quot; field of the cookie string.</p>
<p>Note that the domain here may start with a dot, which is not a valid hostname. However, it means this cookie matches all hostnames ending with that domain name.</p>
<p><b>See also </b><a href="qnetworkcookie.html#setDomain">setDomain</a>().</p>
<!-- @@@domain -->
<!-- $$$expirationDate[overload1]$$$expirationDate -->
<h3 class="fn" id="expirationDate"><a name="expirationDate"></a><span class="type"><a href="../qtcore/qdatetime.html">QDateTime</a></span> QNetworkCookie::<span class="name">expirationDate</span>() const</h3>
<p>Returns the expiration date for this cookie. If this cookie is a session cookie, the <a href="../qtcore/qdatetime.html">QDateTime</a> returned will not be valid. If the date is in the past, this cookie has already expired and should not be sent again back to a remote server.</p>
<p>The expiration date corresponds to the parameters of the &quot;expires&quot; entry in the cookie string.</p>
<p><b>See also </b><a href="qnetworkcookie.html#isSessionCookie">isSessionCookie</a>() and <a href="qnetworkcookie.html#setExpirationDate">setExpirationDate</a>().</p>
<!-- @@@expirationDate -->
<!-- $$$hasSameIdentifier[overload1]$$$hasSameIdentifierconstQNetworkCookie& -->
<h3 class="fn" id="hasSameIdentifier"><a name="hasSameIdentifier"></a><span class="type">bool</span> QNetworkCookie::<span class="name">hasSameIdentifier</span>(const <span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this cookie has the same identifier tuple as <i>other</i>. The identifier tuple is composed of the name, domain and path.</p>
<p><b>See also </b><a href="qnetworkcookie.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@hasSameIdentifier -->
<!-- $$$isHttpOnly[overload1]$$$isHttpOnly -->
<h3 class="fn" id="isHttpOnly"><a name="isHttpOnly"></a><span class="type">bool</span> QNetworkCookie::<span class="name">isHttpOnly</span>() const</h3>
<p>Returns <code>true</code> if the &quot;HttpOnly&quot; flag is enabled for this cookie.</p>
<p>A cookie that is &quot;HttpOnly&quot; is only set and retrieved by the network requests and replies; i.e&#x2e;, the HTTP protocol. It is not accessible from scripts running on browsers.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qnetworkcookie.html#isSecure">isSecure</a>().</p>
<!-- @@@isHttpOnly -->
<!-- $$$isSecure[overload1]$$$isSecure -->
<h3 class="fn" id="isSecure"><a name="isSecure"></a><span class="type">bool</span> QNetworkCookie::<span class="name">isSecure</span>() const</h3>
<p>Returns <code>true</code> if the &quot;secure&quot; option was specified in the cookie string, false otherwise.</p>
<p>Secure cookies may contain private information and should not be resent over unencrypted connections.</p>
<p><b>See also </b><a href="qnetworkcookie.html#setSecure">setSecure</a>().</p>
<!-- @@@isSecure -->
<!-- $$$isSessionCookie[overload1]$$$isSessionCookie -->
<h3 class="fn" id="isSessionCookie"><a name="isSessionCookie"></a><span class="type">bool</span> QNetworkCookie::<span class="name">isSessionCookie</span>() const</h3>
<p>Returns <code>true</code> if this cookie is a session cookie. A session cookie is a cookie which has no expiration date, which means it should be discarded when the application's concept of session is over (usually, when the application exits).</p>
<p><b>See also </b><a href="qnetworkcookie.html#expirationDate">expirationDate</a>() and <a href="qnetworkcookie.html#setExpirationDate">setExpirationDate</a>().</p>
<!-- @@@isSessionCookie -->
<!-- $$$name[overload1]$$$name -->
<h3 class="fn" id="name"><a name="name"></a><span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> QNetworkCookie::<span class="name">name</span>() const</h3>
<p>Returns the name of this cookie. The only mandatory field of a cookie is its name, without which it is not considered valid.</p>
<p><b>See also </b><a href="qnetworkcookie.html#setName">setName</a>() and <a href="qnetworkcookie.html#value">value</a>().</p>
<!-- @@@name -->
<!-- $$$normalize[overload1]$$$normalizeconstQUrl& -->
<h3 class="fn" id="normalize"><a name="normalize"></a><span class="type">void</span> QNetworkCookie::<span class="name">normalize</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>url</i>)</h3>
<p>This functions normalizes the path and domain of the cookie if they were previously empty. The <i>url</i> parameter is used to determine the correct domain and path.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@normalize -->
<!-- $$$parseCookies[overload1]$$$parseCookiesconstQByteArray& -->
<h3 class="fn" id="parseCookies"><a name="parseCookies"></a><code>[static] </code><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span>&gt; QNetworkCookie::<span class="name">parseCookies</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &amp;<i>cookieString</i>)</h3>
<p>Parses the cookie string <i>cookieString</i> as received from a server response in the &quot;Set-Cookie:&quot; header. If there's a parsing error, this function returns an empty list.</p>
<p>Since the HTTP header can set more than one cookie at the same time, this function returns a <a href="../qtcore/qlist.html">QList</a>&lt;<a href="qnetworkcookie.html">QNetworkCookie</a>&gt;, one for each cookie that is parsed.</p>
<p><b>See also </b><a href="qnetworkcookie.html#toRawForm">toRawForm</a>().</p>
<!-- @@@parseCookies -->
<!-- $$$path[overload1]$$$path -->
<h3 class="fn" id="path"><a name="path"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QNetworkCookie::<span class="name">path</span>() const</h3>
<p>Returns the path associated with this cookie. This corresponds to the &quot;path&quot; field of the cookie string.</p>
<p><b>See also </b><a href="qnetworkcookie.html#setPath">setPath</a>().</p>
<!-- @@@path -->
<!-- $$$setDomain[overload1]$$$setDomainconstQString& -->
<h3 class="fn" id="setDomain"><a name="setDomain"></a><span class="type">void</span> QNetworkCookie::<span class="name">setDomain</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>domain</i>)</h3>
<p>Sets the domain associated with this cookie to be <i>domain</i>.</p>
<p><b>See also </b><a href="qnetworkcookie.html#domain">domain</a>().</p>
<!-- @@@setDomain -->
<!-- $$$setExpirationDate[overload1]$$$setExpirationDateconstQDateTime& -->
<h3 class="fn" id="setExpirationDate"><a name="setExpirationDate"></a><span class="type">void</span> QNetworkCookie::<span class="name">setExpirationDate</span>(const <span class="type"><a href="../qtcore/qdatetime.html">QDateTime</a></span> &amp;<i>date</i>)</h3>
<p>Sets the expiration date of this cookie to <i>date</i>. Setting an invalid expiration date to this cookie will mean it's a session cookie.</p>
<p><b>See also </b><a href="qnetworkcookie.html#isSessionCookie">isSessionCookie</a>() and <a href="qnetworkcookie.html#expirationDate">expirationDate</a>().</p>
<!-- @@@setExpirationDate -->
<!-- $$$setHttpOnly[overload1]$$$setHttpOnlybool -->
<h3 class="fn" id="setHttpOnly"><a name="setHttpOnly"></a><span class="type">void</span> QNetworkCookie::<span class="name">setHttpOnly</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>Sets this cookie's &quot;HttpOnly&quot; flag to <i>enable</i>.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qnetworkcookie.html#isHttpOnly">isHttpOnly</a>().</p>
<!-- @@@setHttpOnly -->
<!-- $$$setName[overload1]$$$setNameconstQByteArray& -->
<h3 class="fn" id="setName"><a name="setName"></a><span class="type">void</span> QNetworkCookie::<span class="name">setName</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &amp;<i>cookieName</i>)</h3>
<p>Sets the name of this cookie to be <i>cookieName</i>. Note that setting a cookie name to an empty <a href="../qtcore/qbytearray.html">QByteArray</a> will make this cookie invalid.</p>
<p><b>See also </b><a href="qnetworkcookie.html#name">name</a>() and <a href="qnetworkcookie.html#value">value</a>().</p>
<!-- @@@setName -->
<!-- $$$setPath[overload1]$$$setPathconstQString& -->
<h3 class="fn" id="setPath"><a name="setPath"></a><span class="type">void</span> QNetworkCookie::<span class="name">setPath</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>path</i>)</h3>
<p>Sets the path associated with this cookie to be <i>path</i>.</p>
<p><b>See also </b><a href="qnetworkcookie.html#path">path</a>().</p>
<!-- @@@setPath -->
<!-- $$$setSecure[overload1]$$$setSecurebool -->
<h3 class="fn" id="setSecure"><a name="setSecure"></a><span class="type">void</span> QNetworkCookie::<span class="name">setSecure</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>Sets the secure flag of this cookie to <i>enable</i>.</p>
<p>Secure cookies may contain private information and should not be resent over unencrypted connections.</p>
<p><b>See also </b><a href="qnetworkcookie.html#isSecure">isSecure</a>().</p>
<!-- @@@setSecure -->
<!-- $$$setValue[overload1]$$$setValueconstQByteArray& -->
<h3 class="fn" id="setValue"><a name="setValue"></a><span class="type">void</span> QNetworkCookie::<span class="name">setValue</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &amp;<i>value</i>)</h3>
<p>Sets the value of this cookie to be <i>value</i>.</p>
<p><b>See also </b><a href="qnetworkcookie.html#value">value</a>() and <a href="qnetworkcookie.html#name">name</a>().</p>
<!-- @@@setValue -->
<!-- $$$swap[overload1]$$$swapQNetworkCookie& -->
<h3 class="fn" id="swap"><a name="swap"></a><span class="type">void</span> QNetworkCookie::<span class="name">swap</span>(<span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span> &amp;<i>other</i>)</h3>
<p>Swaps this cookie with <i>other</i>. This function is very fast and never fails.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@swap -->
<!-- $$$toRawForm[overload1]$$$toRawFormQNetworkCookie::RawForm -->
<h3 class="fn" id="toRawForm"><a name="toRawForm"></a><span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> QNetworkCookie::<span class="name">toRawForm</span>(<span class="type"><a href="qnetworkcookie.html#RawForm-enum">QNetworkCookie::RawForm</a></span> <i>form</i> = Full) const</h3>
<p>Returns the raw form of this <a href="qnetworkcookie.html">QNetworkCookie</a>. The <a href="../qtcore/qbytearray.html">QByteArray</a> returned by this function is suitable for an HTTP header, either in a server response (the Set-Cookie header) or the client request (the Cookie header). You can choose from one of two formats, using <i>form</i>.</p>
<p><b>See also </b><a href="qnetworkcookie.html#parseCookies">parseCookies</a>().</p>
<!-- @@@toRawForm -->
<!-- $$$value[overload1]$$$value -->
<h3 class="fn" id="value"><a name="value"></a><span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> QNetworkCookie::<span class="name">value</span>() const</h3>
<p>Returns this cookies value, as specified in the cookie string. Note that a cookie is still valid if its value is empty.</p>
<p>Cookie name-value pairs are considered opaque to the application: that is, their values don't mean anything.</p>
<p><b>See also </b><a href="qnetworkcookie.html#setValue">setValue</a>() and <a href="qnetworkcookie.html#name">name</a>().</p>
<!-- @@@value -->
<!-- $$$operator!=[overload1]$$$operator!=constQNetworkCookie& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QNetworkCookie::<span class="name">operator!=</span>(const <span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this cookie is not equal to <i>other</i>.</p>
<p><b>See also </b><a href="qnetworkcookie.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=QNetworkCookie&& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span> &amp;QNetworkCookie::<span class="name">operator=</span>(<span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-assignment operator.</p><!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQNetworkCookie& -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span> &amp;QNetworkCookie::<span class="name">operator=</span>(const <span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span> &amp;<i>other</i>)</h3>
<p>Copies the contents of the <a href="qnetworkcookie.html">QNetworkCookie</a> object <i>other</i> to this object.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQNetworkCookie& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QNetworkCookie::<span class="name">operator==</span>(const <span class="type"><a href="qnetworkcookie.html#QNetworkCookie">QNetworkCookie</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this cookie is equal to <i>other</i>. This function only returns <code>true</code> if all fields of the cookie are the same.</p>
<p>However, in some contexts, two cookies of the same name could be considered equal.</p>
<p>This function was introduced in  Qt 5.0.</p>
<p><b>See also </b><a href="qnetworkcookie.html#operator-not-eq">operator!=</a>() and <a href="qnetworkcookie.html#hasSameIdentifier">hasSameIdentifier</a>().</p>
<!-- @@@operator== -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>