diff --git a/src/gui/optionsdialog.cpp b/src/gui/optionsdialog.cpp index d3bad9f98ef..264018117d3 100644 --- a/src/gui/optionsdialog.cpp +++ b/src/gui/optionsdialog.cpp @@ -1273,7 +1273,6 @@ void OptionsDialog::loadWebUITabOptions() // Security m_ui->checkClickjacking->setChecked(pref->isWebUIClickjackingProtectionEnabled()); m_ui->checkCSRFProtection->setChecked(pref->isWebUICSRFProtectionEnabled()); - m_ui->checkSecureCookie->setEnabled(pref->isWebUIHttpsEnabled()); m_ui->checkSecureCookie->setChecked(pref->isWebUISecureCookieEnabled()); m_ui->groupHostHeaderValidation->setChecked(pref->isWebUIHostHeaderValidationEnabled()); m_ui->textServerDomains->setText(pref->getServerDomains()); @@ -1315,7 +1314,6 @@ void OptionsDialog::loadWebUITabOptions() connect(m_ui->checkClickjacking, &QCheckBox::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkCSRFProtection, &QCheckBox::toggled, this, &ThisType::enableApplyButton); - connect(m_ui->checkWebUIHttps, &QGroupBox::toggled, m_ui->checkSecureCookie, &QWidget::setEnabled); connect(m_ui->checkSecureCookie, &QCheckBox::toggled, this, &ThisType::enableApplyButton); connect(m_ui->groupHostHeaderValidation, &QGroupBox::toggled, this, &ThisType::enableApplyButton); connect(m_ui->textServerDomains, &QLineEdit::textChanged, this, &ThisType::enableApplyButton); diff --git a/src/gui/optionsdialog.ui b/src/gui/optionsdialog.ui index 11299615fdc..17f9b1b51b4 100644 --- a/src/gui/optionsdialog.ui +++ b/src/gui/optionsdialog.ui @@ -3675,7 +3675,7 @@ Specify an IPv4 or IPv6 address. You can specify "0.0.0.0" for any IPv - Enable cookie Secure flag (requires HTTPS) + Enable cookie Secure flag (requires HTTPS or localhost) diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index d175cb2a5ac..e48a4bb9ffb 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -744,7 +744,7 @@ void WebApplication::sessionStart() QNetworkCookie cookie {m_sessionCookieName.toLatin1(), m_currentSession->id().toLatin1()}; cookie.setHttpOnly(true); - cookie.setSecure(m_isSecureCookieEnabled && m_isHttpsEnabled); + cookie.setSecure(m_isSecureCookieEnabled && (m_isHttpsEnabled || env().clientAddress.isLoopback())); cookie.setPath(u"/"_s); if (m_isCSRFProtectionEnabled) cookie.setSameSitePolicy(QNetworkCookie::SameSite::Strict); diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index d98decab1f5..89bbb1bdabb 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -980,7 +980,7 @@
- +
@@ -1957,7 +1957,6 @@ const isUseHttpsEnabled = $("use_https_checkbox").checked; $("ssl_cert_text").disabled = !isUseHttpsEnabled; $("ssl_key_text").disabled = !isUseHttpsEnabled; - $("secureCookieCheckbox").disabled = !isUseHttpsEnabled; }; const updateBypasssAuthSettings = function() {