🐛 webui: Fix bug of cookie cannot set expiration (#622)

This commit is contained in:
Rirmach 2024-11-04 02:30:27 +08:00 committed by GitHub
parent 5c2e555727
commit 139035a21e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -741,6 +741,7 @@ void WebApplication::sessionStart()
cookie.setHttpOnly(true);
cookie.setSecure(m_isSecureCookieEnabled && m_isHttpsEnabled);
cookie.setPath(u"/"_s);
cookie.setExpirationDate(QDateTime::currentDateTime().addSecs(m_sessionTimeout));
if (m_isCSRFProtectionEnabled)
cookie.setSameSitePolicy(QNetworkCookie::SameSite::Strict);
else if (cookie.isSecure())