You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ma...@gxs.com on 2004/09/16 21:12:36 UTC

Question about creating new HttpSessions

First a little background.  I am working on a servlet that has a login
page that creates new HttpSessions.  If my users close their browser
windows between calls to the login page everything works wonderfully.
But if they browse to the page while they still have a cookie from an
old session, the method HttpServletRequest.getSession(true) returns the
old session.  I want to force the creation of a new HttpSession in this
case.  I do not want to invalidate the old session, I just want a new
session.
My servlet is deployed to a Tomcat 4.1.x container, but if I have to
I can move to Tomcat 5.0.x.  In the ideal world, I would like to keep
my servlet container independent, but if I have to do something Tomcat
specific I will.
My question is: Is there any way to force the creation of a new
HttpSession, even if the HttpServletRequest has a cookie for an
old session?
Thank you in advance for your help
--matt hoover