tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jones" <kev...@develop.com>
Subject RE: HttpSession.isNew() Bug?
Date Thu, 02 Mar 2000 10:58:14 GMT
I see this fix in the latest drop of Tomcat, but it doesn't work for me. In
fact I never see the 'access' method called. So sessions still don't work
for me!

Kevin Jones
DevelopMentor

> -----Original Message-----
> From: gyang [mailto:gyang]On Behalf Of Gary Yang
> Sent: 01 March 2000 20:18
> To: tomcat-dev@jakarta.apache.org
> Subject: Re: HttpSession.isNew() Bug?
>
>
> I believe here is a bug.
>
> To fix it, add a line to the end of funciont
> org.tomcat.session.StandardSession.access():
> this.isNew = false;
>
> i.e. replace file
> src/share/org/apache/tomcat/session/StandardSession.java's line 339-349
> from
>
>     /**
>      * Update the accessed time information for this session.  This
> method
>      * should be called by the context when a request comes in for a
> particular
>      * session, even if the application does not reference it.
>      */
>     public void access() {
>
>         this.lastAccessedTime = this.thisAccessedTime;
>         this.thisAccessedTime = System.currentTimeMillis();
>
>     }
>
> to:
>    /**
>      * Update the accessed time information for this session.  This
> method
>      * should be called by the context when a request comes in for a
> particular
>      * session, even if the application does not reference it.
>      */
>     public void access() {
>
>         this.lastAccessedTime = this.thisAccessedTime;
>         this.thisAccessedTime = System.currentTimeMillis();
>         this.isNew = false;    // ************this line should be added
>
>     }
>
>
>
>
> Gary Young wrote:
>
> > It seems isNew() always return true in Tomcat 3.1.
> > I have tested the function using both JSP and servlet.
> > Here is a JSP file:
> > <HTML>
> > <HEAD>
> >         <TITLE>JSP session page</TITLE>
> > </HEAD>
> > <BODY>
> > <%
> >         HttpSession ses=request.getSession(true);
> >         if(ses.isNew()) {
> > %>
> > <%=ses.getId()%>
> > <%      }
> > %>
> > </BODY>
> > </HTML>
> >
> > The file always outputs the session's ID when it is
> > run
> > in Tomcat. However, if the application server is IBM
> > WebSphere(2.03 on Linux, and 3.02 on Solaris), it
> > ouputs the ID only at the first time.
> >
> > Why does the function always return true? Is it a bug?
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Talk to your friends online with Yahoo! Messenger.
> > http://im.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message