Title: Sessions with JSSI servlet

Maybe I'm missing something completely obvious, so please point me in the right direction if I am.  Our setup is Windows NT, Apache 1.3.12, and JServ 1.1.2.

We've got a servlet that generates tables from a database.  We insert these tables as part of .JHTML pages using <SERVLET> blocks.  Because we associate the .JHTML extension with the SSI servlet in JSERV.CONF, a request for the page first goes to the SSI servlet, then on to our servlet for each <SERVLET> block.  Now the problem/question:

In our zone.properties file, we've configured "session.useCookies=true" so cookies get used to maintain the session ID.  In our servlet, when we call "req.getSession(true)" to get our current session, it appears to create a session the first time, and store it in the cookie list.  But the problem I think I'm seeing is that this is too late in the sequence of events, as the cookies are already on their way back to the browser. The SSI servlet has already started to write data back to the client, including the cookies in the headers.  So it seems that it's too late for us in our servlet to call getSession(), if one is going to be created.

How do I force a session to be created in our servlet, if we're going to always be called first by the SSI servlet?

Jay

-- Jay Burgess
   Digital Archaeology
   mailto:[EMAIL PROTECTED]
   (913) 438-9444 x154


Reply via email to