14 :QObject(parent), useQtSettings(true)
19 cookieName=settings->value(
"cookieName",
"sessionid").toByteArray();
21 qDebug(
"HttpSessionStore: Sessions expire after %i milliseconds",
expirationTime);
32 qDebug(
"HttpSessionStore: Sessions expire after %i milliseconds",
expirationTime);
46 if (sessionId.isEmpty())
52 if (!sessionId.isEmpty())
56 qDebug(
"HttpSessionStore: received invalid session cookie with ID %s",sessionId.data());
68 if (!sessionId.isEmpty())
92 qDebug(
"HttpSessionStore: create new session with ID %s",session.
getId().data());
115 qint64 now=QDateTime::currentMSecsSinceEpoch();
116 QMap<QByteArray,HttpSession>::iterator
i =
sessions.begin();
119 QMap<QByteArray,HttpSession>::iterator prev =
i;
125 qDebug(
"HttpSessionStore: session %s expired",session.
getId().data());
QByteArray getSessionId(HttpRequest &request, HttpResponse &response)
HttpSession getSession(HttpRequest &request, HttpResponse &response, bool allowCreate=true)
QMap< QByteArray, HttpCookie > & getCookies()
qint64 getLastAccess() const
QMap< QByteArray, HttpSession > sessions
void setCookie(const HttpCookie &cookie)
HttpSessionStore(QSettings *settings, QObject *parent=NULL)
QByteArray getCookie(const QByteArray &name) const
virtual ~HttpSessionStore()
void removeSession(HttpSession session)
HttpSessionsSettings sessionsSettings