You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by André Silva <an...@gmail.com> on 2008/06/25 20:59:38 UTC

Problems with logout with Tomcat JDBCRealm

Hi All =)
This is my first message here, sorry for the poor english.

I'm using Tomcat JDBCRealm to authentication and authorization in my app.
Login works fine, and when the user press the logout button(calls the
session.invalidate()), he cannot login again.
When the user tries to login, the application is redirected to the page
which is configured in <form-error-page> in the web.xml. It is like the user
entered the wrong password.

This is my problem.
The user makes the login and then the logout. After this, the user only can
login again if the Tomcat is restarted.
It is like tomcat is holding the login.

I'm using Tomcat 6.

My configurations:

logout.jsp
<%
session.invalidate();
response.sendRedirect("/WebDesktop");
%>

web.xml
<login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
        <form-login-page>/pages/login.faces</form-login-page>
        <form-error-page>/pages/error.faces</form-error-page>
    </form-login-config>
</login-config>

Any idea ?

--
André SIlva

Re: Problems with logout with Tomcat JDBCRealm

Posted by Thomas Haines <th...@recallmedia.com.au>.
Hi André

> I'm using Tomcat JDBCRealm to authentication and authorization in my  
> app.
> Login works fine, and when the user press the logout button(calls the
> session.invalidate()), he cannot login again.

You could try adding:
session.removeAttribute("User");

before you invalidate the session.

> When the user tries to login, the application is redirected to the  
> page
> which is configured in <form-error-page> in the web.xml. It is like  
> the user
> entered the wrong password.

When you say "user can only login" .... do you mean tomcat gives them  
the option to enter their user/pass and it's denied?

Tom

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org