0 Replies Latest reply on Nov 22, 2010 4:54 PM by Nicolas U.

    Logout bug after automatic login redirection

    Nicolas U. Newbie
      Hello all.

      I met a strange behavior in seam.

      I use eclipse 3.6 + jboss tool Nightly Builds + seam 2.2.0 GA + Jboss AS 5.1.

      In my project i have:

      WebContent
        |_protected
        |     |_search.page.xml
        |     |_search.xhtml
        |_login.page.xml
        |_login.xhtml

      If you are not logged, you have only acces @login.xhtml
      And if you are yet logged (no logout and same sessionid) and you back on website, you are redirect to search.xhml (don't need to log again)

      To do this i use this way:
      http://community.jboss.org/wiki/AutomaticLoginRedirection

      It's work fine, nothing to say.

      My probleme is when i logout.

      In first case i use this to do logout (like in default seam project):
      <s:link view="/login.xhtml" action="#{identity.logout}" value="Logout" rendered="#{identity.loggedIn}" propagation="none"/>

      But after a logout, i was unable to login again (can't restore session error)

      I have replace <s:link> in search.xhtml by
      <h:form id="logoutForm">
        <a4j:commandLink value="Logout" action="#{identity.logout}" rendered="#{identity.loggedIn}" />
      </h:form>
      and in login.page.xml i have add:
      <navigation from-action="#{identity.logout}">
        <redirect view-id="/login.xhtml" />
      </navigation>

      It's work now but i don't understand why i can't do it with <s:link>
      I need to add logout navigation in each page in protected, it's quite boring.

      Ayone have an idea why i can't use <s:link> for logout?

      Thx