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

  • Home
  • SEARCH
  • 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 8865121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:25:23+00:00 2026-06-14T16:25:23+00:00

I am using Spring Security 3.1 to handle login authentication, session timeouts and maximum

  • 0

I am using Spring Security 3.1 to handle login authentication, session timeouts and maximum sessions.

Also I am deleting cookies only on logout.

<logout delete-cookies="JSESSIONID" logout-success-url='logout page' />

Also I have set maximum sessions to 1 as of now for testing.
When I open my webpage in browser, it stores jsession id in cookie but the problem starts when I exit and reopen my browser. At this time I cannot find any cookies in the browser, they get deleted that is why I am not getting redirected to welcome page(page after login).

But when I login again, it shows an error message that I am printing:-number of sessions exceeded.

This possibly means that session remains alive on server side but it gets deleted from the cookie on client side due to which I neither see the welcome page nor am able to login on the login page.

What else I need to do so that cookies remain there in the browser till the session times out? I have set session timeout to 10 days

  • 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-14T16:25:24+00:00Added an answer on June 14, 2026 at 4:25 pm

    This is normal behaviour. JSESSIONID cookies are only valid for the lifetime of a browser session so are gone when you close your browser. This isn’t something you can change.

    There is no connection between the browser’s perception of a session and the lifetime of a session on the server. Unless you actually log out, the server session is still there until it times out and is removed by the server (10 days in your case). Until that happens, trying to log in again will exceed the number of allowed sessions.

    If you want to stay logged in for 10 days, you might want to look at using remember-me cookies rather than the standard servlet container session.

    Unless you have a definite requirement for restricting the number of concurrent sessions a user can have, I would avoid using that as it will just cause you problems. You haven’t actually shown your configuration for this, but there are really just two options. Either a user can log back in again and the previous session will be marked as expired, or attempting to log in a second time will cause an error until the previous session has timed out, or the user logs out to explicitly invalidate it. The behaviour is controlled by the error-if-maximum-exceeded namespace attribute.

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

Sidebar

Related Questions

I'm using Spring to handle security in my JSF application. I have a login
I'm using Spring Security 3 and my ApplicationContext-Security.xml specifies <form-login login-page=/genesis default-target-url=/diagnostics/start-diagnostics authentication-failure-url=/genesis?authfailed=true authentication-success-handler-ref=customTargetUrlResolver/>
I am trying to programatically validate a user login/pass using Spring Security, so I
I'm using Spring Security 3.0.2 form based authentication. But I can't figure out how
I am using form-login for security and I am trying to implement an authentication
I'm using Spring 2.5.6 and Spring security 2.0. For login attempts I implements the
I have tried to implement a success handler for login using Spring security with
I'm using spring-security web authentication with spring-mvc, all is well so far, but now
i am using spring framework,apache,tomcat and the login page is handled with spring security
I am developing a GWT application which im using Spring Security to handle the

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.