QNetworkCookie Class Reference |
Constant | Value | Description |
---|---|---|
QNetworkCookie::NameAndValueOnly | 0 | makes toRawForm() return only the "NAME=VALUE" part of the cookie, as suitable for sending back to a server in a client request's "Cookie:" header. Multiple cookies are separated by a semi-colon in the "Cookie:" header field. |
QNetworkCookie::Full | 1 | makes toRawForm() return the full cookie contents, as suitable for sending to a client in a server's "Set-Cookie:" header. Multiple cookies are separated by commas in a "Set-Cookie:" header. |
Note that only the Full form of the cookie can be parsed back into its original contents.
See also toRawForm() and parseCookies().
Create a new QNetworkCookie object, initializing the cookie name to name and its value to value.
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.
Creates a new QNetworkCookie object by copying the contents of other.
Destroys this QNetworkCookie object.
Returns the domain this cookie is associated with. This corresponds to the "domain" field of the cookie string.
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.
See also setDomain().
Returns the expiration date for this cookie. If this cookie is a session cookie, the QDateTime 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.
The expiration date corresponds to the parameters of the "expires" entry in the cookie string.
See also isSessionCookie() and setExpirationDate().
Returns true if the "secure" option was specified in the cookie string, false otherwise.
Secure cookies may contain private information and should not be resent over unencrypted connections.
See also setSecure().
Returns true 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).
See also expirationDate() and setExpirationDate().
Returns the name of this cookie. The only mandatory field of a cookie is its name, without which it is not considered valid.
See also setName() and value().
Parses the cookie string cookieString as received from a server response in the "Set-Cookie:" header. If there's a parsing error, this function returns an empty list.
Since the HTTP header can set more than one cookie at the same time, this function returns a QList<QNetworkCookie>, one for each cookie that is parsed.
See also toRawForm().
Returns the path associated with this cookie. This corresponds to the "path" field of the cookie string.
See also setPath().
Sets the domain associated with this cookie to be domain.
See also domain().
Sets the expiration date of this cookie to date. Setting an invalid expiration date to this cookie will mean it's a session cookie.
See also isSessionCookie() and expirationDate().
Sets the name of this cookie to be cookieName. Note that setting a cookie name to an empty QByteArray will make this cookie invalid.
Sets the path associated with this cookie to be path.
See also path().
Sets the secure flag of this cookie to enable.
Secure cookies may contain private information and should not be resent over unencrypted connections.
See also isSecure().
Sets the value of this cookie to be value.
Returns the raw form of this QNetworkCookie. The QByteArray 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 form.
See also parseCookies().
Returns this cookies value, as specified in the cookie string. Note that a cookie is still valid if its value is empty.
Cookie name-value pairs are considered opaque to the application: that is, their values don't mean anything.
See also setValue() and name().
Returns true if this cookie is not equal to other.
See also operator==().
Copies the contents of the QNetworkCookie object other to this object.
Returns true if this cookie is equal to other. This function only returns true if all fields of the cookie are the same.
However, in some contexts, two cookies of the same name could be considered equal.
See also operator!=().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.4 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com