File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes HttpSession question? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "HttpSession question?" Watch "HttpSession question?" New topic

HttpSession question?

Jeff Madrid

Joined: Nov 07, 2003
Posts: 14
I'm running Tomcat 4.1.30. I'm using both a Servlet and a Struts Action to call a JSP. I've included the session="false" attribute in the page directive and I do not reference a session in the Servlet or Action. Regardless, Tomcat creates a session according to the Tomcat Manager application. How can I prevent the overhead of Tomcat creating an unneeded session. My hack workaround is to call session.invalidate() but this does not prevent the expense of session creation. Thanks in advance for your time.

Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I'm fairly certain someone asked this recently on Tomcat user. The answer was basically "Tomcat will always create a session, but whether it is used or not is another question." The people there went on to proclaim that the 'overhead' of session creation is breathtakingly minimal, and that an empty session is 'vanishingly small' in terms of memory.
Consider Paul's rocket mass heater.
subject: HttpSession question?
It's not a secret anymore!