Results 1 to 4 of 4

Thread: Immediate signing in after logout causes redirection to home page

  1. #1

    Post Immediate signing in after logout causes redirection to home page

    I have a common login and logout screen. When i logout after signing in... I come to signin page. Default behavior of spring security invalidates the session on logout so if i try to sign-in using the same screen, i get redirected to home page as there is no session available at that point. The desired behavior should be able to sign-in immediately after sign-out, which is not happening due to session invalidation

    Code:
    <http use-expressions="true" access-denied-page="/access-denied">
        <intercept-url pattern="/secured/user/sign-up" access="hasAnyRole('ROLE_USER','ROLE_ANONYMOUS')" />
        <intercept-url pattern="/secured/user/sign-in" access="hasRole('ROLE_ANONYMOUS')" />
        <intercept-url pattern="/secured/**" requires-channel="https" />
        <intercept-url pattern="/user/dashboard/**" access="hasAnyRole('ROLE_IC')" />
        <intercept-url pattern="/**" access="permitAll"
            requires-channel="http" />
        <form-login login-page="/secured/user/sign-in" 
            authentication-success-handler-ref="authenticationSuccessHandler"
            authentication-failure-url="/secured/user/sign-in" />
        <logout logout-success-url="/secured/user/sign-in?loggedout=true"
            logout-url="/secured/logout"/>
        <security:session-management
            session-fixation-protection="none">
        </security:session-management>
    </http>
    If you refer to the xml, you will see /secured/user/sign-in is used for both sign-in and sign-out

    How can I handle this issue ?

  2. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    This just sounds like the expected behaviour. Are you really that you don't want the session invalidated when the user logs out?
    Spring - by Pivotal
    twitter @tekul

  3. #3

    Default

    Yes, i want session to invalidate but also want spring to create a new session and authenticate on the next request. The problem here is after sign out I am unable to sign-in. This works fine if I refresh the browser and sign-in as a new session gets created and spring is able to authenticate.

  4. #4
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    There doesn't need to be a session in order to authenticate. One will be created as necessary.
    Spring - by Pivotal
    twitter @tekul

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •