tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Sidney-Woollett <>
Subject Prevent session creation by DefaultServlet
Date Sun, 21 Nov 2004 15:45:18 GMT
Is there any way on tomcat 5.0.x to prevent tomcat/defaultServlet 
creating a session when serving static image files (*.jpg, *.gif, *.png)?

This is only an issue if the browser has cookies switched off (and some 
users do).

I know you can prevent the creation of a session in a JSP with (<%@ page 
session="false" %>), but is there a way of doing this for other 
resources (like images)?

We log all new sessions in a database, but we're finding when a browser 
has cookies switched off the defaultservlet/tomcat is generating a new 
session to serve each graphic elements on the page and it's clogging up 
our session monitor/logger (which implements HttpSessionListener).

Also it's hard to distinguish these sessions from real user sessions - 
although we can if we use a filter to check the request URL to see what 
resource was requested, and then ignore the image requests.

Any ideas?

John Sidney-Woollett

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message