23 #ifndef TUFAO_SESSIONSETTINGS_H
24 #define TUFAO_SESSIONSETTINGS_H
26 #include <QtNetwork/QNetworkCookie>
27 #include <QtCore/QDateTime>
60 QNetworkCookie
cookie(
const QByteArray &value = QByteArray())
const
62 return cookie(*
this, value);
70 const QByteArray &value = QByteArray())
75 cookie.setExpirationDate(QDateTime::currentDateTimeUtc()
76 .addSecs(settings.
timeout * 60));
78 cookie.setHttpOnly(settings.
httpOnly);
79 cookie.setSecure(settings.
secure);
80 if (!settings.
domain.isEmpty()) cookie.setDomain(settings.
domain);
81 if (!settings.
path.isEmpty()) cookie.setPath(settings.
path);
83 cookie.setName(settings.
name);
84 cookie.setValue(value);
193 #endif // TUFAO_SESSION_H
QByteArray name
The name to which cookies generated by this object are used.
Definition: sessionsettings.h:117
The SessionSettings class exposes details that sessions use to handle cookies.
Definition: sessionsettings.h:55
bool secure
Whether cookies generated by this object should only be used through secure connections.
Definition: sessionsettings.h:160
QNetworkCookie cookie(const QByteArray &value=QByteArray()) const
Creates a cookie, using value as the cookie's value.
Definition: sessionsettings.h:60
int timeout
Define the lifetime of cookies generated by this object (a timeout specified in minutes).
Definition: sessionsettings.h:100
This is the namespace where all Tufão facilities are grouped.
Definition: abstracthttpserverrequesthandler.h:30
QByteArray domain
The hosts to which cookies generated by this object are used.
Definition: sessionsettings.h:188
static QNetworkCookie cookie(const SessionSettings &settings, const QByteArray &value=QByteArray())
Creates a cookie, using value as the cookie's value and settings as cookie's settings.
Definition: sessionsettings.h:69
bool httpOnly
Whether cookies generated by this object should only be used in HTTP requests.
Definition: sessionsettings.h:111
QByteArray path
The set of paths to which cookies generated by this object are used.
Definition: sessionsettings.h:141