W3C home > Mailing lists > Public > www-jigsaw@w3.org > July to August 1999

Re: (Firgured it out !)Sessions are dying ...

From: Augusto Sellhorn <asellhor@ccd.harris.com>
Date: Thu, 15 Jul 1999 09:17:29 -0400 (EDT)
Message-ID: <378DDFB7.E0A9791B@ccd.harris.com>
To: www-jigsaw@w3.org

HttpSession.setMaxInactiveInterval() is acting weird because 
 
./org/w3c/jigsaw/servlet/JigsawHttpSessionContext.java
should be

90: long maxinterval = 
    (maxinactiveinterval > 0) ? maxinactiveinterval * 1000 : maxidle;

Right now, max inactive interval is being interpreted as milliseconds,
whereas the JSDK 2.1 spec specifies that it is in seconds.

I don't know about maxidle , seems like an internal Jigsaw parameter
to me ...

Hopefully somebody could make the change to the source code whenever
possible :)

Augusto

Augusto Sellhorn wrote:
> 
> My configuration is Jigsaw 2.0.2 , JSDK 2.1, JDK 1.1.6 (AIX) and NS 4.5
> 
> My sessions objects are being nuked every 30 seconds. It doesn't matter
> what value I set for setMaxInactiveInterval() , every 30 seconds, it
> creates a new session object.
> 
> Also, why are my session objects being killed ? I thought since the
> session is being used (reg.getSession()) that should keep the session
> alive ?
> 
> Here's a sample servlet to test this behavior. Use the servlet and
> hit shit-reload every second or so. You'll see that the session dies
> even though you're using it every second.
> 
> <pre>
> +==================================
> import java.io.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> 
> public class TestSession extends HttpServlet
> {
>         static Vector history = new Vector();
> 
>         public void doGet(HttpServletRequest req, HttpServletResponse
> res)
>                 throws ServletException, IOException
>         {
>                 HttpSession session = req.getSession(true);
>                 if (session.isNew())
>                 history.addElement("Session " + session.getId() + "
> created " +
>                         new Date(session.getCreationTime()));
>                 res.setContentType("text/html");
>                 PrintWriter out= res.getWriter();
> 
>                 session.setMaxInactiveInterval(10);
> 
>                 out.println("<title>TestSession</title><html><pre>Here
> is your session information : <br>");
>                 out.println("<br>= SESSION
> ============================================");
>                 if (session.isNew())    out.println("<br><B>***** NEW
> SESSION *****</B>");
>                 out.println("<br>Session : " + session );
>                 out.println("<br>ID      : " + session.getId());
>                 out.println("<br>Created : " + new
> Date(session.getCreationTime()));
>                 out.println("<br>Accessed: " + new
> Date(session.getLastAccessedTime()));
>                 out.println("<br>Inactive: " +
> session.getMaxInactiveInterval() + " seconds.");
>                 out.println("<br>isNew   : " + session.isNew());
>                 if (session.isNew())    out.println("<br><br><B>*****
> NEW SESSION *****</B>");
> 
>                 out.println("<br><br>Session creation History;");
>                 Enumeration e = history.elements();
>                 while (e.hasMoreElements())
> out.println((String)e.nextElement());
> 
> out.println("<br>======================================================");
> 
>                 out.println("</pre></html>");
>         }
> }
> +==================================
> </pre>
> 
> Here's some sample output
> 
> +================================
> 
> Here is your session information :
> 
> = SESSION ============================================
> ***** NEW SESSION *****
> Session : org.w3c.jigsaw.servlet.JigsawHttpSession@603437d
> ID      : J-40105124-63
> Created : Wed Jul 14 11:56:38 EDT 1999
> Accessed: Wed Jul 14 11:56:38 EDT 1999
> Inactive: 10 seconds.
> isNew   : true
> ***** NEW SESSION *****
> Session creation History;
> Session J-40411524-59 created Wed Jul 14 11:51:31 EDT 1999
> Session J-40383748-60 created Wed Jul 14 11:51:59 EDT 1999
> Session J-40353662-61 created Wed Jul 14 11:52:29 EDT 1999
> Session J-40323644-62 created Wed Jul 14 11:52:59 EDT 1999
> Session J-40105124-63 created Wed Jul 14 11:56:38 EDT 1999
> ======================================================
Received on Thursday, 15 July 1999 09:18:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:29 GMT