Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7892351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:50:53+00:00 2026-06-03T06:50:53+00:00

How can I disable resetting session timeout in Tomcat 5.5 for particular requests? On

  • 0

How can I disable resetting session timeout in Tomcat 5.5 for particular requests? On a page I have a javascript function that periodically sends ajax calls to the server. On server side I don’t want these calls to renew session lifetime.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:50:55+00:00Added an answer on June 3, 2026 at 6:50 am

    Ok, since you didn’t like my first idea, I came up with this JSP demonstration.
    It’s kind of a hack but it does work. To test, copy and paste.
    Browse to the first JSP. It will start a session and set the inactive interval.
    After being redirected, keep hitting the Refresh button on your browser.
    No matter how times you request the second JSP, the current session will die.

    test1.jsp

    <%
       session.setMaxInactiveInterval(20); //for easy testing
       response.sendRedirect("test2.jsp");
    %>
    

    test2.jsp

    <%@ page session="false" import="java.util.*" %>
    <%
      HttpSession session = request.getSession(false);
      if(session == null){
                      out.print("Error, No Session!");
                      return;
      }
      long creationTime = session.getCreationTime();
      long now = new Date().getTime();
      long lastAccessedTime = session.getLastAccessedTime();
      int oldInterval = session.getMaxInactiveInterval();
      int inactivePeriod = (int)(now - lastAccessedTime)/1000; 
      session.setMaxInactiveInterval(oldInterval - inactivePeriod); 
      int newInterval = session.getMaxInactiveInterval();
    %>
    <html>
    <body>
    session id is <%=session.getId()%>
    <br/><%=creationTime%> = creationTime
    <br/><%=lastAccessedTime%> = lastAccessedTime
    <br/><%=now%> = now
    <br/><%=oldInterval%> = oldInterval in seconds 
    <br/><%=inactivePeriod%> = inactivePeriod
    <br/><%=newInterval%> = newInterval in seconds 
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I disable the dangerous eval function? Can that be done using ini_set
I can disable viewstate of each control, but not entire page. Is there a
Can I disable the minimize button in JFrame? I have already tried setUndecorated() and
I have an ASP.net mvc page that executes a jquery script on load. The
In C++ you can disable a function in parent's class by declaring it as
I have a notification that needs to repeat daily. It can be turned off
How can I disable all MSVC warnings that come from the boost library? I
I've been seeing a lot of websites saying that you can disable the effects
I have a business object that can be edited via PropertyGrid. It contains list
You can disable Javascript in both mobile Safari and Cocoa's WebView but I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.