1 Reply Latest reply on Apr 21, 2009 9:42 PM by brandonsimpson

    redirecting where left after logout

    mcalpay

      Hello,


      I am using the following to redirect to the original page after the user has logged in (as documented in reference):


      <event type="org.jboss.seam.security.notLoggedIn">
           <action execute="#{redirect.captureCurrentView}" />
      </event>
      
      <event type="org.jboss.seam.security.postAuthenticate">
           <action execute="#{redirect.returnToCapturedView}" />
      </event>
      



      This does not work after the user calls identity.logout() on a login required page. User is redirected to the login page. After the login user does not get redirected to the page where the logout was hit. I believe its because session invalidated at a later time. Best way to implement this so user starts the work where he left ? Its more of a curiosity thing than a real problem...


      regards

        • 1. Re: redirecting where left after logout
          brandonsimpson

          I think the events you mentioned above are designed for a different purpose. Those are for when a user requests a page (perhaps through a bookmark) that requires login. In that case the page they requested is captured by the first event you listed and after login, the second event returns to that page with the user authenticated. You could capture a similar event on logout, but like you said, the session is invaldiated so most likely that will be wiped out. Only other thing I could think of is stuffing the page you want them to go back to in a cookie or something like that.