|
cutelyst
3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|
The Cutelyst Cookie. More...
#include <Cutelyst/Cookie>

Public Types | |
| enum | SameSite { SameSite::Default, SameSite::None, SameSite::Lax, SameSite::Strict } |
Public Types inherited from QNetworkCookie | |
| enum | RawForm |
Public Member Functions | |
| Cookie (const QByteArray &name=QByteArray(), const QByteArray &value=QByteArray()) | |
| Create a new Cookie object, initializing the cookie name to name and its value to value. More... | |
| Cookie (const Cookie &other) | |
| Creates a new Cookie object by copying the contents of other. | |
| ~Cookie () | |
| Destroys this Cookie object. | |
| bool | operator!= (const Cookie &other) const |
| Returns true if this cookie is not equal to other. | |
| Cookie & | operator= (Cookie &&other) noexcept |
| Move assigns the contents of the Cookie object other to this object. | |
| Cookie & | operator= (const Cookie &other) |
| Copies the contents of the Cookie object other to this object. | |
| bool | operator== (const Cookie &other) const |
| Returns true if this cookie is equal to other. More... | |
| SameSite | sameSitePolicy () const |
| Returns the "SameSite" option if specified in the cookie string, SameSite::Default if not present. | |
| void | setSameSitePolicy (SameSite sameSite) |
| Sets the "SameSite" option of this cookie to sameSite. | |
| void | swap (Cookie &other) noexcept |
| Swaps this cookie with other. More... | |
| QByteArray | toRawForm (RawForm form=Full) const |
| Returns the raw form of this Cookie. More... | |
Public Member Functions inherited from QNetworkCookie | |
| QNetworkCookie (const QByteArray &name, const QByteArray &value) | |
| QNetworkCookie (const QNetworkCookie &other) | |
| QString | domain () const const |
| QDateTime | expirationDate () const const |
| bool | hasSameIdentifier (const QNetworkCookie &other) const const |
| bool | isHttpOnly () const const |
| bool | isSecure () const const |
| bool | isSessionCookie () const const |
| QByteArray | name () const const |
| void | normalize (const QUrl &url) |
| bool | operator!= (const QNetworkCookie &other) const const |
| QNetworkCookie & | operator= (const QNetworkCookie &other) |
| bool | operator== (const QNetworkCookie &other) const const |
| QString | path () const const |
| void | setDomain (const QString &domain) |
| void | setExpirationDate (const QDateTime &date) |
| void | setHttpOnly (bool enable) |
| void | setName (const QByteArray &cookieName) |
| void | setPath (const QString &path) |
| void | setSecure (bool enable) |
| void | setValue (const QByteArray &value) |
| void | swap (QNetworkCookie &other) |
| QByteArray | toRawForm (QNetworkCookie::RawForm form) const const |
| QByteArray | value () const const |
Additional Inherited Members | |
Static Public Member Functions inherited from QNetworkCookie | |
| QList< QNetworkCookie > | parseCookies (const QByteArray &cookieString) |
Public Attributes inherited from QNetworkCookie | |
| Full | |
| NameAndValueOnly | |
This is an extension of QNetworkCookie that adds support for the SameSite property. QNetworkCookie added support for the SameSite property in Qt 6.1. So, if you are only using Qt 6.1 or newer, please use QNetworkCookie and the methods that take it as argument instead.
|
strong |
|
explicit |
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.
Definition at line 15 of file cookie.cpp.
| bool Cookie::operator== | ( | const Cookie & | other | ) | const |
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.
Definition at line 38 of file cookie.cpp.
References QNetworkCookie::operator==().
|
inlinenoexcept |
This function is very fast and never fails.
Definition at line 75 of file cookie.h.
References QNetworkCookie::swap().
| QByteArray Cookie::toRawForm | ( | RawForm | form = Full | ) | const |
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.
Definition at line 74 of file cookie.cpp.
References QLocale::c(), Default, QNetworkCookie::domain(), QNetworkCookie::expirationDate(), QNetworkCookie::Full, QAbstractSocket::IPv6Protocol, QNetworkCookie::isHttpOnly(), QNetworkCookie::isSecure(), QNetworkCookie::isSessionCookie(), QNetworkCookie::name(), QNetworkCookie::path(), QHostAddress::protocol(), QUrl::toAce(), QString::toLatin1(), QLocale::toString(), QString::toUtf8(), and QNetworkCookie::value().
1.8.14