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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:31:47+00:00 2026-05-29T04:31:47+00:00

I am using Spring Security 3.1 and am using <concurrency-control max-sessions=1 error-if-maximum-exceeded=true /> I

  • 0

I am using Spring Security 3.1 and am using

 <concurrency-control max-sessions="1" error-if-maximum-exceeded="true" />
  • I open a browser and log in (Ex. IE9)
  • I close that browser
  • I open a different browser (Ex. Firefox)
  • I cannot log in because I am still logged in on the other browser

Is there a way to force the session to close when the browser closes? I need to keep the max-sessions to 1 for concurrency control.

Thanks!

  • 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-29T04:31:49+00:00Added an answer on May 29, 2026 at 4:31 am

    I would add a custom filter of my own just before the “CONCURRENT_SESSION_FILTER” and check in the request URI for a string like “force-logout.do” (or something similar).

    Then, in the HTML generated I would have a JavaScript event handler like the following:

    <script type="text/javascript">
    function force_logout() {
      // AJAX request to server notifying that the browser has been closed.
    }
    </script>
    
    <body onbeforeunload="force_logout();">
    </body>
    

    That would work for IE and Firefox (you should check other browsers as well). Your filter just needs to check the URI and perform a session.invalidate() in case it matches the “force logout URI” and return immediately or just bypass the request to the filter chain otherwise.

    NOTE: I’m not adding the AJAX code since I don’t know if you are using a specific AJAX framework. With prototype.js it would be fairly simple.

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

Sidebar

Related Questions

I have a problem with my j2ee application using spring security. I set max-sessions
We're using Spring Security to control access to some services. It is working fine
I'm building a webapp with role based access control using Acegi (Spring) security. So
I am running NTLM using Spring Security, I am getting the following error org.springframework.beans.factory.NoSuchBeanDefinitionException:
I have used spring security 3.0.7 and I am implementing concurrency control in my
Using Spring Security 3.1.0, I cannot seem to get the concurrent session control feature
When using spring security, specifically with @notation; what is the proper way to access
I'm using Spring Security 3.0.2 and I can't find a way to load roles
I'm using Spring, Spring Security, BlazeDS, Flex and spring-flex. I know that I can
I am trying to programatically validate a user login/pass using Spring Security, so I

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.