30 void HttpSessionStore::init() {
62 QByteArray
id =
sessionId(request, response);
91 QDateTime now = QDateTime::currentDateTime();
92 QHash<QByteArray, HttpSession>::iterator i =
m_sessions.begin() ;
94 QHash<QByteArray, HttpSession>::iterator prev = i;
QByteArray id() const
Returns session ID.
const HttpSettings * settings() const
Returs pointer to HttpSettings used in the HttpServer.
const QString & sessionCookieName() const
Returns session cookie name.
QByteArray sessionId(HttpRequest *request, HttpResponse *response)
Returns session ID associated with the request or response.
HttpSessionStore(const HttpSettings *settings, QObject *parent)
Constructor.
QDateTime lastAccess()
Return time of last access to the session.
Information about one session.
void setLastAccess()
Sets time of last access to the session.
QString m_sessionCookieName
The name of the session cookie.
General single-threaded, event-driven HTTP server.
void aboutToRemove(const HttpSession &session) const
Signal is emited when a session is about to remove from storage.
HttpSession session(HttpRequest *request, HttpResponse *response)
Returns session associated with the request or response.
HttpCookie cookie(const QString &name)
Returns cookie.
One cookie of HTTP protocol.
QVariant value(const QString &key) const
Returns an item from the session.
void remove(HttpSession session)
Removes session.
QHash< QByteArray, HttpSession > m_sessions
List of stored sessions.
Response to HTTP request - headers, cookies and body.
QString value() const
Returns the value of cookie.
QTimer * m_cleaner
Timer for store cleaning from old sessions.
Configuration of the http server instance.
void setCookie(const HttpCookie &cookie)
Sets a cookie.
const HttpSettings * m_settings
Pointer to http server settings.
QString cookie(const QString &name) const
Returns cookie.
int sessionExpirationTime() const
Returns maximum expiration time for the session.
Processes HTTP request, parses headers, body and files sent by HTTP protocol.
void slotCleaner()
Slot cleans the store from old sessions.
Namespace of HTTP server.
const QString & sessionCookieName() const
Returns the session cookie name.