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

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 6a24ef8277 Follow-up to "Report unlimited TTL for sessions that never 
time out..."
6a24ef8277 is described below

commit 6a24ef82777c705d4a4935ec95b05c2001d74c87
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Oct 7 19:38:13 2026 +0100

    Follow-up to "Report unlimited TTL for sessions that never time out..."
---
 java/org/apache/catalina/manager/JspHelper.java | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/manager/JspHelper.java 
b/java/org/apache/catalina/manager/JspHelper.java
index 5a990af774..a6e801edbc 100644
--- a/java/org/apache/catalina/manager/JspHelper.java
+++ b/java/org/apache/catalina/manager/JspHelper.java
@@ -82,7 +82,7 @@ public class JspHelper {
      */
     public static String getDisplayCreationTimeForSession(Session in_session) {
         try {
-            if (in_session.getCreationTime() == 0) {
+            if (in_session.getCreationTime() <= 0) {
                 return "";
             }
             DateFormat formatter = new SimpleDateFormat(DATE_TIME_FORMAT);
@@ -101,7 +101,7 @@ public class JspHelper {
      */
     public static String getDisplayLastAccessedTimeForSession(Session 
in_session) {
         try {
-            if (in_session.getLastAccessedTime() == 0) {
+            if (in_session.getLastAccessedTime() <= 0) {
                 return "";
             }
             DateFormat formatter = new SimpleDateFormat(DATE_TIME_FORMAT);
@@ -120,7 +120,7 @@ public class JspHelper {
      */
     public static String getDisplayUsedTimeForSession(Session in_session) {
         try {
-            if (in_session.getCreationTime() == 0) {
+            if (in_session.getCreationTime() <= 0) {
                 return "";
             }
         } catch (IllegalStateException ise) {
@@ -134,11 +134,11 @@ public class JspHelper {
      * Returns the formatted time-to-live for the given session.
      *
      * @param in_session the session
-     * @return the formatted TTL string, or "Unlimited" for sessions that 
never time out
+     * @return the formatted TTL string, or the infinity symbol for sessions 
that never time out
      */
     public static String getDisplayTTLForSession(Session in_session) {
         try {
-            if (in_session.getCreationTime() == 0) {
+            if (in_session.getCreationTime() <= 0) {
                 return "";
             }
         } catch (IllegalStateException ise) {
@@ -147,7 +147,8 @@ public class JspHelper {
         }
         long ttl = SessionUtils.getTTLForSession(in_session);
         if (ttl == Long.MAX_VALUE) {
-            return "Unlimited";
+            // Use the infinity symbol here rather than 'Unlimited' or similar 
to avoid i18n.
+            return "\u221e";
         }
         return secondsToTimeString(ttl / 1000);
     }
@@ -160,7 +161,7 @@ public class JspHelper {
      */
     public static String getDisplayInactiveTimeForSession(Session in_session) {
         try {
-            if (in_session.getCreationTime() == 0) {
+            if (in_session.getCreationTime() <= 0) {
                 return "";
             }
         } catch (IllegalStateException ise) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to