Turn off sessions in your JSPs
One of the tips I picked up in J2EE Design and Development was to turn off automatic session-creation in your JSPs. So I tried this today on my project, and it doesn't seem to work. Basically this involved putting the following at the top of your JSPs:
<%@ page session="false"%>
I did this by adding this to my taglibs.jsp, which is included in every other JSP - so it should affect all my JSPs and prevent a session from being created on my welcome-file - right? Not according to Tomcat's Manager application - it still increments the number of sessions as I hit the welcome page with different browsers. Am I doing something wrong?
I'd love to get this working - so sessions are only created when a user logs in. Those JSPs that need a session, I'll override the default with session="true". I often see a whole bunch of sessions on the wiki and roller apps on this site - and in reality - a session should never be created, unless I login. At least I think that's how this is designed to work...
Posted by Gary Blomquist on January 22, 2004 at 08:13 PM MST #
Posted by Russ on January 22, 2004 at 10:14 PM MST #
Posted by Robert Nicholson on January 23, 2004 at 08:48 AM MST #
Posted by andi on January 23, 2004 at 02:41 PM MST #