tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Lucia" <>
Subject RE: turning off sessions
Date Tue, 07 Feb 2006 21:58:59 GMT
     * Process HTTP request
     * @param request HTTP Request object
     * @param response HTTP Reqponse object
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response) 
        throws IOException, ServletException 
        PrintWriter pw = response.getWriter();

        boolean session = request.getParameter("session") != null;
        pw.println("Session:      \"" + request.getSession(session) + "\"");


Session:      "null"

But if I tack on ?session, it creates one as expected:

Session:      "org.apache.catalina.session.StandardSessionFacade@1395dab"

So, the JSP must be the source of the session.  I learned something new
today.  I don't know why (yet).


-----Original Message-----
From: Tim Lucia [] 
Sent: Tuesday, February 07, 2006 4:49 PM
To: 'Tomcat Users List'
Subject: RE: turning off sessions

Interesting.  You are right.  A trivial jsp with only text inside produces a
session.  I am fairly certain I have seen servlets (not JSPs) behaving
without any session tracking at all.

-----Original Message-----
From: David Durham []
Sent: Tuesday, February 07, 2006 4:37 PM
To: Tomcat Users List
Subject: Re: turning off sessions

Tim Lucia wrote:
> Tomcat doesn't create sessions.  Web applications create sessions.  
> I.e., code says:
> HttpSession session =
> ((HttpServletRequest)request).getSession({true|false}); // true for 
> create if not exist, false for don't create);

That's strange because there is no call to getSession() in my code.  So,
maybe it's the result of the fact that I'm using a JSP.  If that's the case,
then Tomcat is, in a sense, creating sessions.

Anyway, I think the context configuration that I had:

<Context path="/app">
     <Manager maxInactiveInterval="6"/>

conflicts with the default session-config from conf/web.xml


I added:


to my app, and that's good enough for me.



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

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

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

View raw message