Skip to content

Commit

Permalink
WebUI: append port to session cookie name
Browse files Browse the repository at this point in the history
  • Loading branch information
dyseg committed Oct 15, 2024
1 parent 075f1d5 commit 62b986a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/webui/webapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#include "freediskspacechecker.h"

const int MAX_ALLOWED_FILESIZE = 10 * 1024 * 1024;
const QString DEFAULT_SESSION_COOKIE_NAME = u"SID"_s;
const QString DEFAULT_SESSION_COOKIE_NAME = u"QBT_SID"_s;

const QString WWW_FOLDER = u":/www"_s;
const QString PUBLIC_FOLDER = u"/public"_s;
Expand Down Expand Up @@ -179,7 +179,7 @@ WebApplication::WebApplication(IApplication *app, QObject *parent)
LogMsg(tr("Unacceptable session cookie name is specified: '%1'. Default one is used.")
.arg(m_sessionCookieName), Log::WARNING);
}
m_sessionCookieName = DEFAULT_SESSION_COOKIE_NAME;
m_sessionCookieName = DEFAULT_SESSION_COOKIE_NAME + QString::number(m_webUiPort);
}

m_freeDiskSpaceChecker->moveToThread(m_workerThread.get());
Expand Down Expand Up @@ -440,6 +440,7 @@ void WebApplication::configure()
m_isAuthSubnetWhitelistEnabled = pref->isWebUIAuthSubnetWhitelistEnabled();
m_authSubnetWhitelist = pref->getWebUIAuthSubnetWhitelist();
m_sessionTimeout = pref->getWebUISessionTimeout();
m_webUiPort = pref->getWebUIPort();

m_domainList = pref->getServerDomains().split(u';', Qt::SkipEmptyParts);
std::for_each(m_domainList.begin(), m_domainList.end(), [](QString &entry) { entry = entry.trimmed(); });
Expand Down
1 change: 1 addition & 0 deletions src/webui/webapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ class WebApplication final : public ApplicationComponent<QObject>
QList<Utils::Net::Subnet> m_authSubnetWhitelist;
int m_sessionTimeout = 0;
QString m_sessionCookieName;
quint16 m_webUiPort;

// security related
QStringList m_domainList;
Expand Down

0 comments on commit 62b986a

Please sign in to comment.