File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes HttpSessions in WTE (VAJ 4) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "HttpSessions in WTE (VAJ 4)" Watch "HttpSessions in WTE (VAJ 4)" New topic
Author

HttpSessions in WTE (VAJ 4)

Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
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
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


------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
You've got it 100% Kyle! many thanks
Steve
 
 
subject: HttpSessions in WTE (VAJ 4)
 
Threads others viewed
Selenium/Fitnesse and JSP
Servlet API 2.2
controlling maxActiveSessions
HELP!! VAJ and WEBSPHER STUDIO problems!!!!!!!!!!!!!
Killing a session in a servlet!!
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture