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 3488026
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:13:14+00:00 2026-05-18T11:13:14+00:00

i am using spring framework,apache,tomcat and the login page is handled with spring security

  • 0

i am using spring framework,apache,tomcat
and the login page is handled with spring security
and i have an issue
that every first time request to the login page is generating a new session for the user, i know it’s the default behaviour, when you access the login page, a new session is created for you, then what if a large load made on the login page, too many users are just viewing the login page without doing anything, so too many un-used sessions are created here.
what do you guys think of just an issue, i know it’s rare, but it may occur, how to deal with it ?

  • 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-05-18T11:13:15+00:00Added an answer on May 18, 2026 at 11:13 am

    I don’t think thats rare. One possible solute could be to set the session timeout to a minimum. For example 5 minutes. Further you can write a filter to increase the session timeout if a session already exists for the user. So normal user will have a session timeout of 30 minutes and users only visit one side have a timeout of 5 minutes.

    Here is a filter that dose the trick:

    public void doFilter(ServletRequest request, ServletResponse response,
            FilterChain chain) throws IOException, ServletException {
    
        HttpServletRequest httpRequest = (HttpServletRequest)request;
    
        // The false is important, otherwise a new session will be created.
        HttpSession session = httpRequest.getSession(false);
    
        if (session == null) {
            chain.doFilter(request, response);
            return;
        }
    
        session.setMaxInactiveInterval(30 * 60);
        chain.doFilter(request, response);
    }
    

    Another good advice is to filter crawlers like the google bot. “Bot Detection” is a good keyword to look for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have started using Spring framework in my project. After becoming acquainted with the
Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring
I have a j2ee application using spring framework. I am trying to export jasper
I got a web application using the spring-security framework. I setted up a database
I have a web project built in eclipse using Spring and for Tomcat. Before
I'm using : Apache Tomcat 6.0.20 Spring 3.x I want to create simple Hello
I am using Spring 3.0.3, MyBatis 3.0.2 and mybatis-spring 1.0.0 on Apache Tomcat 6.0.29.
I'm building a MVC web application (using the Spring MVC framework), and I'm a
I'm using hibernate validator framework with Spring. A class implementing the Spring Validator validates
I'm using Spring.net with NHiberante (HibernateTemplate) to implement my DAO's. I also have some

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.