Skip to content

PythonQt.Qt.QNetworkCookie

QNetworkCookie

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

Cookies are small bits of information that stateless protocols like HTTP use to maintain some persistent information across requests.

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.

QNetworkCookie 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.

A cookie can also have an expiration date, indicating its validity. If the expiration date is not present, the cookie is considered a "session cookie" and should be discarded when the application exits (or when its concept of session is over).

QNetworkCookie provides a way of parsing a cookie from the HTTP header format using the QNetworkCookie::parseCookies() function. However, when received in a QNetworkReply, the cookie is already parsed.

This class implements cookies as described by the initial cookie specification by Netscape, which is somewhat similar to the RFC 2109 specification, plus the "HttpOnly" extension. The more recent RFC 2965 specification (which uses the Set-Cookie2 header) is not supported.

Source: https://doc.qt.io/archives/qt-5.15/qnetworkcookie.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
Full attribute Any (shared captured text)
NameAndValueOnly attribute Any (shared captured text)
RawForm attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
domain function (self) -> str X.domain() -> str (shared captured text)
expirationDate function (self) -> Any X.expirationDate() -> PythonQt.QtCore.QDateTime (shared captured text)
hasSameIdentifier function (self, other: Any) -> bool X.hasSameIdentifier(other) -> bool (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
isHttpOnly function (self) -> bool X.isHttpOnly() -> bool (shared captured text)
isSecure function (self) -> bool X.isSecure() -> bool (shared captured text)
isSessionCookie function (self) -> bool X.isSessionCookie() -> bool (shared captured text)
name function (self) -> Any X.name() -> PythonQt.QtCore.QByteArray (shared captured text)
normalize function (self, url: Any) -> None This functions normalizes the path and domain of the cookie if they were previously empty. (shared captured text)
parseCookies function (self, cookieString: Any) -> tuple X.parseCookies(cookieString) -> tuple (shared captured text)
path function (self) -> str X.path() -> str (shared captured text)
setDomain function (self, domain: str) -> None Sets the domain associated with this cookie to be domain. (shared captured text)
setExpirationDate function (self, date: Any) -> None Sets the expiration date of this cookie to date. (shared captured text)
setHttpOnly function (self, enable: bool) -> None Sets this cookie's "HttpOnly" flag to enable. (shared captured text)
setName function (self, cookieName: Any) -> None Sets the name of this cookie to be cookieName. (shared captured text)
setPath function (self, path: str) -> None Sets the path associated with this cookie to be path. (shared captured text)
setSecure function (self, enable: bool) -> None Sets the secure flag of this cookie to enable. (shared captured text)
setValue function (self, value: Any) -> None Sets the value of this cookie to be value. (shared captured text)
swap function (self, other: Any) -> None Swaps this cookie with other. (shared captured text)
toRawForm function (self, form: Any) -> Any X.toRawForm(form) -> PythonQt.QtCore.QByteArray (shared captured text)
value function (self) -> Any X.value() -> PythonQt.QtCore.QByteArray (shared captured text)