This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch branch_10_0
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_10_0 by this push:
     new ea098380407 SOLR-17864: solr.http.disableCookies --> 
solr.http.cookies.enabled (#3833)
ea098380407 is described below

commit ea098380407c613112e5ad29b783fd08e36cca08
Author: Eric Pugh <[email protected]>
AuthorDate: Sun Nov 16 08:50:20 2025 -0500

    SOLR-17864: solr.http.disableCookies --> solr.http.cookies.enabled (#3833)
    
    * Flip property named to .enabled pattern.
    * Add missing configuration stanza to windows equivalent solr.in.cmd file.
---
 solr/bin/solr.in.cmd                                           |  4 ++++
 solr/bin/solr.in.sh                                            | 10 +++++-----
 .../modules/configuration-guide/pages/solr-properties.adoc     |  2 ++
 .../org/apache/solr/client/solrj/impl/Http2SolrClient.java     |  2 +-
 .../src/resources/DeprecatedSystemPropertyMappings.properties  |  2 ++
 .../src/java/org/apache/solr/SolrTestCaseJ4.java               |  2 +-
 6 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/solr/bin/solr.in.cmd b/solr/bin/solr.in.cmd
index 4adaa748a05..c90a9fa1c32 100755
--- a/solr/bin/solr.in.cmd
+++ b/solr/bin/solr.in.cmd
@@ -250,3 +250,7 @@ REM set SOLR_MODULES=extraction,ltr
 REM Configure the default replica placement plugin to use if one is not 
configured in cluster properties
 REM See 
https://solr.apache.org/guide/solr/latest/configuration-guide/replica-placement-plugins.html
 for details
 REM set SOLR_PLACEMENTPLUGIN_DEFAULT=simple
+
+REM Solr internally doesn't use cookies. If you don't need any of those, and 
you don't 
+REM need them for an external system (such as a load balancer), you can 
disable the use of a CookieStore with:
+REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.solrj.http.cookies.enabled=false
diff --git a/solr/bin/solr.in.sh b/solr/bin/solr.in.sh
index 8fae75a820e..4752790d44f 100644
--- a/solr/bin/solr.in.sh
+++ b/solr/bin/solr.in.sh
@@ -250,12 +250,12 @@
 # This variable provides you with the option to disable the Admin UI. If you 
uncomment the variable below and
 # change the value to false. The option is configured as a system property as 
defined in SOLR_START_OPTS in the start
 # scripts.
-# SOLR_UI_ENABLED=true
+#SOLR_UI_ENABLED=true
 
 # This variable provides you with the option to disable the new experimental 
Admin UI. If you uncomment the variable
 # below and change the value to false, Jetty will not load the new-ui module 
which update the CSP directive for the
 # new UI endpoints. This property is ignored if SOLR_UI_ENABLED is false.
-# SOLR_UI_EXPERIMENTAL_ENABLED=false
+#SOLR_UI_EXPERIMENTAL_ENABLED=false
 
 # Solr is by default allowed to read and write data from/to SOLR_HOME and a 
few other well defined locations
 # Sometimes it may be necessary to place a core or a backup on a different 
location or a different disk
@@ -278,10 +278,10 @@
 
 # Some previous versions of Solr use an outdated log4j dependency. If you are 
unable to use at least log4j version 2.15.0
 # then enable the following setting to address CVE-2021-44228
-# SOLR_OPTS="$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true"
+#SOLR_OPTS="$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true"
 
 # The bundled plugins in the "modules" folder can easily be enabled as a 
comma-separated list in SOLR_MODULES variable
-# SOLR_MODULES=extraction,ltr
+#SOLR_MODULES=extraction,ltr
 
 # Configure the default replica placement plugin to use if one is not 
configured in cluster properties
 # See 
https://solr.apache.org/guide/solr/latest/configuration-guide/replica-placement-plugins.html
 for details
@@ -289,4 +289,4 @@
 
 # Solr internally doesn't use cookies. If you don't need any of those, and you 
don't 
 # need them for an external system (such as a load balancer), you can disable 
the use of a CookieStore with:
-# SOLR_OPTS="$SOLR_OPTS -Dsolr.http.disableCookies=true"
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.solrj.http.cookies.enabled=false"
diff --git 
a/solr/solr-ref-guide/modules/configuration-guide/pages/solr-properties.adoc 
b/solr/solr-ref-guide/modules/configuration-guide/pages/solr-properties.adoc
index a635789006c..a12d182b54f 100644
--- a/solr/solr-ref-guide/modules/configuration-guide/pages/solr-properties.adoc
+++ b/solr/solr-ref-guide/modules/configuration-guide/pages/solr-properties.adoc
@@ -108,6 +108,8 @@ NOTE: Properties marked with "!" indicate inverted meaning 
between pre Solr 10 a
 
 |solr.solrj.cloud.max.stale.retries|cloudSolrClientMaxStaleRetries|5|Sets the 
maximum number of retries for stale connection attempts in SolrJ cloud client.
 
+|solr.solrj.http.cookies.enabled|!solr.http.disableCookies| false |If 
Http2SolrClient should support cookies.
+
 
|solr.streamingexpressions.facet.tiered.enabled|solr.facet.stream.tiered|true|Controls
 whether tiered faceting is enabled for streaming expressions.
 
 
|solr.streamingexpressions.macros.enabled|StreamingExpressionMacros|false|Controls
 whether to expand URL parameters inside of the `expr` parameter.
diff --git 
a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java 
b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
index dab3e979517..a7b777cbc54 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
@@ -1050,7 +1050,7 @@ public class Http2SolrClient extends HttpSolrClientBase {
       if (cookieStore == null) {
         return cookieStore;
       }
-      if (Boolean.getBoolean("solr.http.disableCookies")) {
+      if (!EnvUtils.getPropertyAsBool("solr.solrj.http.cookies.enabled", 
false)) {
         return new HttpCookieStore.Empty();
       }
       /*
diff --git 
a/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties 
b/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties
index f5bb1b3ab26..eabb2459df1 100644
--- a/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties
+++ b/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties
@@ -32,6 +32,8 @@ solr.host.bind=solr.jetty.host
 
 solr.host.advertise=host
 
+solr.solrj.http.cookies.enabled=!solr.http.disable.cookies
+
 solr.index.replication.fingerprint.enabled=!solr.disableFingerprint
 solr.index.updatelog.enabled=enable.update.log
 
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java 
b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index 8068705858a..da99074d3a8 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -278,7 +278,7 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
     System.setProperty("solr.clustering.enabled", "false");
     System.setProperty("solr.cloud.wait-for-updates-with-stale-state-pause", 
"500");
     System.setProperty("solr.filterCache.async", 
String.valueOf(random().nextBoolean()));
-    System.setProperty("solr.http.disableCookies", Boolean.toString(rarely()));
+    System.setProperty("solr.solrj.http.cookies.enabled", 
Boolean.toString(usually()));
     System.setProperty("solr.metrics.jvm.enabled", "false");
     System.setProperty("solr.metrics.otlpExporterInterval", "1000");
 

Reply via email to