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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:48:00+00:00 2026-06-17T16:48:00+00:00

I have in my applicationContext-security.xml <session-management session-authentication-error-url=/genesis> <concurrency-control max-sessions=1 error-if-maximum-exceeded=true expired-url=/genesis?sessionExpired=true/> </session-management> which limits

  • 0

I have in my applicationContext-security.xml

<session-management session-authentication-error-url="/genesis"> 
        <concurrency-control max-sessions="1" error-if-maximum-exceeded="true" expired-url="/genesis?sessionExpired=true"/> 
    </session-management>

which limits a user to a single session. However, I now have a requirement that one account must be allowed multiple sessions whilst still limiting all other accounts to single session.

Any suggestions as to how I can achieve this?

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

    Override default concurrency filter. Skip processing for your special user:

    public class CustomConcurrentSessionFilter extends ConcurrentSessionFilter {
    
        @Override
        public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException,
            ServletException {
            Authentication auth = SecurityContextHolder.getContext().getAuthentication();
            if (!auth.getName().equals("bob")) {
                super.doFilter(req, res, chain);
            }
        }
    
    }
    

    Replace default filter by custom one in conf:

    <security:http ... >
        <security:custom-filter position="CONCURRENT_SESSION_FILTER" ref="customConcurrentSessionFilter"/>
    </security:http>
    
    <bean id="customConcurrentSessionFilter" class="com.domain.CustomConcurrentSessionFilter"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have config (applicationContext-security.xml): <authentication-manager alias=authenticationManager> <authentication-provider> <password-encoder hash=sha/> <jdbc-user-service data-source-ref=dataSource/> </authentication-provider> </authentication-manager> from other
Have a JUNIT test set up as such @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ /applicationContext.xml, /applicationContext-security.xml }) @TransactionConfiguration(defaultRollback
I have a working 3.0.2 applicationContext-security.xml that uses a custom authenticator <global-method-security pre-post-annotations=disabled> </global-method-security>
I have following entries web.xml: <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml /WEB-INF/spring-security.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> applicationContext:
I have a Spring Web application with an applicationContext.xml loaded through a ContextLoaderListener in
I have my spring security set up to do basic authentication to a database
I have an ApplicationContext.xml file with the following node: <context:property-placeholder location=classpath:hibernate.properties, classpath:pathConfiguration.properties /> It
I have in my applicationContext.xml <context:property-placeholder location=classpath*:*.properties /> <bean id=clientPreferencesManager class=pl.bildpresse.bildchat2.business.ClientPreferencesManager > <property name=clientApiUrl
I have this in my applicationContext.xml <bean class=org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter /> <mvc:annotation-driven conversion-service=conversionService/> <bean id=conversionService class=org.springframework.context.support.ConversionServiceFactoryBean>
I am new to spring security I have web.xml <?xml version=1.0 encoding=UTF-8?> <web-app xmlns=http://java.sun.com/xml/ns/javaee

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.