You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by tw...@sceptical.co.uk on 2001/10/19 10:03:44 UTC

JDBC Realm/logout-problem with Netscape/Mozilla - Cookie needed?

Hi,

I am running Tomcat 3.2.3 under Linux and (for test purposes) Windows NT. My application uses JDBC-Realm and form-based login. Everything works ok for IE, Opera and Konqueror (except a strange delay): I log in with user/password, work and then use a logout procedure as follows:

(...)
public class logout extends HttpServlet {
  private static final String CONTENT_TYPE = "text/html";
  /**Globale Variablen initialisieren*/
  public void init(ServletConfig config) throws ServletException {
    super.init(config);
  }
  /**Die HTTP-Anforderung Get bearbeiten*/
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    String url="/index.html";
    HttpSession session = request.getSession(true);
    Connection tbcon = (Connection)session.getAttribute("texdbcon");
    if(tbcon != null) {
      try {
        tbcon.close();
        } catch (SQLException ex)
          {ex.printStackTrace();}
    }
    session.invalidate();
    RequestDispatcher dispatcher =
      getServletContext().getRequestDispatcher(url);
    dispatcher.forward(request, response);
  }

  public void destroy() {
  }
}

As mentioned above everything works ok with IE and Opera. But to log out does'nt work with Netscape and Mozilla. When logging out for the first time and starting the application again (I use  index.html then a link to a protected page which forces to call login.jsp) the login page appears as expected. But when doing the same procedure a second time the protected page appears at once although I am logged out! I have examined the cookies and the concerned cookie is still there. When purging the cookie manually everything works as expected. The same when closing the browser and starting again.
Under Konqueror and Linux there is a strange delay. I have to wait when logged out and only after a while it is possible to log in again normally.

Can anyone tell me what is going wrong? How to force destroying the  cookie in the browser?
By the way: I have to enable cookies when using JDB Realm, url-rewriting does not work. Is this normal?

Regards
twr



>:-) As sceptical as one can be! (-:<



----------
Personalise your email address at http://another.com
THINK: your slogan or email address on a gorgeous mousemat
CLICK HERE http://another-shop.com