From cbfd62645887acb3850ee34f370d0d59c2ae4328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Wed, 20 May 2015 20:00:55 +0200 Subject: [PATCH] changed cookies expiration time in web server --- .../server/lib/bfHttpServer/httpsessionstore.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/YACReaderLibrary/server/lib/bfHttpServer/httpsessionstore.cpp b/YACReaderLibrary/server/lib/bfHttpServer/httpsessionstore.cpp index af7dc50c..87ce7d4a 100644 --- a/YACReaderLibrary/server/lib/bfHttpServer/httpsessionstore.cpp +++ b/YACReaderLibrary/server/lib/bfHttpServer/httpsessionstore.cpp @@ -14,7 +14,7 @@ HttpSessionStore::HttpSessionStore(QSettings* settings, QObject* parent) connect(&cleanupTimer,SIGNAL(timeout()),this,SLOT(timerEvent())); cleanupTimer.start(60000); cookieName=settings->value("cookieName","sessionid").toByteArray(); - expirationTime=settings->value("expirationTime",86400000).toInt(); + expirationTime=settings->value("expirationTime",864000000).toInt(); qDebug("HttpSessionStore: Sessions expire after %i milliseconds",expirationTime); } @@ -90,7 +90,9 @@ void HttpSessionStore::timerEvent() { ++i; HttpSession session=prev.value(); qint64 lastAccess=session.getLastAccess(); - if (now-lastAccess>expirationTime) { + if (now-lastAccess>expirationTime) { //TODO cleaning up will cause current opened comic to be deleted, so clients won't be able to download it + //If the cleaning occurs in the midle of a download it going to cause issues + //Temporal fix: use a big expirationTime = 10 days qDebug("HttpSessionStore: session %s expired",session.getId().data()); sessions.erase(prev); }