[java-shib-shared] branch main updated: JSSH-60 - Support for managing multiple prefixed cookies

Scott Cantor cantor.2 at osu.edu
Tue Apr 8 19:27:49 UTC 2025


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-shib-shared.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-shared.git;a=commit;h=bef2a72c3625855b53466bc41ed5b2b90fd2bf7d

The following commit(s) were added to refs/heads/main by this push:
     new bef2a72c JSSH-60 - Support for managing multiple prefixed cookies
bef2a72c is described below

commit bef2a72c3625855b53466bc41ed5b2b90fd2bf7d
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Apr 8 15:27:47 2025 -0400

    JSSH-60 - Support for managing multiple prefixed cookies
    
    https://shibboleth.atlassian.net/browse/JSSH-60
    
    Allow for no cookie limit when purging.
---
 .../src/main/java/net/shibboleth/shared/net/CookieManager.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/shib-networking/src/main/java/net/shibboleth/shared/net/CookieManager.java b/shib-networking/src/main/java/net/shibboleth/shared/net/CookieManager.java
index ae2c58d5..136c905b 100644
--- a/shib-networking/src/main/java/net/shibboleth/shared/net/CookieManager.java
+++ b/shib-networking/src/main/java/net/shibboleth/shared/net/CookieManager.java
@@ -495,6 +495,11 @@ public class CookieManager extends AbstractInitializableComponent {
      * @since 9.2.0
      */
     public void purgeStaleCookies(@Nonnull @NotEmpty final String prefix) {
+        
+        if (getCookieLimit() == 0) {
+            return;
+        }
+        
         final Cookie[] cookies = getHttpServletRequest().getCookies();
         if (cookies == null || cookies.length == 0) {
             return;
@@ -508,8 +513,7 @@ public class CookieManager extends AbstractInitializableComponent {
             }
         }
 
-        // This is off by one because we're about to set one.
-        int maxCookies = cookieLimit;
+        int maxCookies = getCookieLimit();
         int purgedCookies = 0;
         
         for (final String nameToPurge : sortedNames.descendingSet()) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list