I'm trying to test my application which uses servlets and JSPs in the WTE of VAJ4 Prof Ed. I've set my browser to prompt me to decide whether to accept cookies. I have a login servlet which starts a session ... HttpSession session=request.getSession(true); then I do lots of work using various servlets & JSPs which access the session data and finally I logout by invalidating the session and then forward to a goodbye page ... session.invalidate(); try { getServletContext().getRequestDispatcher(goodbyepage).forward(request,response); } etc The current session is invalidated but it seems to automatically create a new session & I get prompted to accept a new cookie in the goodbye page. Basically everything is working OK except that I can't get rid of the session! I have code in my intermediate servlets to check if we are in a valid session & if not to forward to the login page. When I try to test this out of course I have a new empty session so the forward doesn't happen. I can work round it by trying to get a control object from the session & forwarding to the login page if I can't get it but I'd rather have things work properly. Any idea whats going on here? Is this particular to the WTE or will I see the same behaviour in WAS 4 when I deploy the application? Thanks Steve McCain
Kyle Brown
author
Ranch Hand
Joined: Aug 10, 2001
Posts: 3878
posted
0
Originally posted by Kyle Brown: By default, JSP's have a built-in call to HttpRequest.getSession(true). You must turn that off by using < %@ page session="false"%>. I am guessing your Goodbye page is a JSP and that it's recreating your session. Kyle