3

I would like to use Spring Session in an xml-config-based project, but without support for multiple sessions (user-logins) in the same browser window.

Can that be disabled? If yes, how?

3
  • hope it may help you. stackoverflow.com/questions/12985862/… Aug 1, 2016 at 7:17
  • 1
    What do you want to disable, only multiple logins but allow multiple sessions with same login? Or do you want to only allow one single session per browser? It is not the same thing... Aug 1, 2016 at 7:54
  • I want only one single session per browser. I don't want the ?_s=x mechanism at all for now.
    – yglodt
    Aug 1, 2016 at 11:16

1 Answer 1

2

As per CookieHttpSessionStrategy#setSessionAliasParamName javadoc:

Sets the name of the HTTP parameter that is used to specify the session alias. If the value is null, then only a single session is supported per browser.

So with Spring XML config this translates to:

<bean class="org.springframework.session.web.http.CookieHttpSessionStrategy">
    <property name="sessionAliasParamName">
        <null/>
    </property>
</bean>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.