https://bz.apache.org/bugzilla/show_bug.cgi?id=69657

            Bug ID: 69657
           Summary: session timeout not set when accessing / and its
                    redirected to index.jsp
           Product: Tomcat 10
           Version: 10.1.40
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: zackha...@yahoo.com.au
  Target Milestone: ------

I added in my index.jsp

Session Timeout=<%= session.getMaxInactiveInterval() %>

and when I access https://<host>:<port>/

it shows

Session Timeout=120

so my session timeout in 2minutes

but my conf/web.xml has a timeout of 3 hours

<session-timeout>180</session-timeout>

but when I access when I access https://<host>:<port>/index.jsp it has the
correct timeout and shows

Session Timeout=10800

so the timeout is not set when accessing https://<host>:<port>/

This issue was in 9.0.102 also and I upgraded to the latest 10 and thought it
be fixed by found same issue.

I had to add this workaround to my index.jsp

<% 
int timeout=session.getMaxInactiveInterval();
%>

<script>
   console.log("Session Timeout=<%= timeout %>");
<%
if (timeout < 1000) {
   session.setMaxInactiveInterval(180*60); //3hrs
   timeout=session.getMaxInactiveInterval();
%>
   console.log("Session Timeout=<%= timeout %>");
<%
}
%>
</script>

and in my console log i see

02:30:45.577 Session Timeout=120 
02:30:45.578 Session Timeout=10800

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to