|
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 class | SameSite { Default , None , Lax , Strict } |
Public Member Functions | |
| Cookie (const Cookie &other) | |
| Creates a new Cookie object by copying the contents of other. | |
| 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. | |
| ~Cookie () | |
| Destroys this Cookie object. | |
| bool | operator!= (const Cookie &other) const |
| Returns true if this cookie is not equal to other. | |
| Cookie & | operator= (const Cookie &other) |
| Copies the contents of the Cookie object other to this object. | |
| Cookie & | operator= (Cookie &&other) noexcept |
| Move assigns 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. | |
| 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. | |
| QByteArray | toRawForm (RawForm form=Full) const |
| Returns the raw form of this Cookie. | |
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.
| Cookie::Cookie | ( | const Cookie & | other | ) |
Definition at line 23 of file cookie.cpp.
|
inline |
Definition at line 31 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.
| Cookie::SameSite Cookie::sameSitePolicy | ( | ) | const |
Definition at line 47 of file cookie.cpp.
| void Cookie::setSameSitePolicy | ( | Cookie::SameSite | sameSite | ) |
Definition at line 52 of file cookie.cpp.
|
inlinenoexcept |
| 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 Default.