Hi Charlie,

I beg to differ. I am seeing the same problem as report by Zhiyong Li and
have been unable to resolve it (and I have a Servlet and do not turn off the
session). 

In case where the browser is not set to accept cookies, session.isNew()
should always return true and not false (as you say).

Arif.

> -----Original Message-----
> From: Charlie Toohey [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 13, 2002 1:23 PM
> To: Tomcat Users List; Zhiyong Li
> Subject: Re: session question for tomcat 4.0.1 and 4.0.2
> 
> First, of all, the assumption is that you have not turned off session
support
> using the JSP page directive, i.e. you do NOT have
> <%@ page session="false">
> The default is "true", so as long as you do not have this, you are fine.
> 
> Now, session.isNew() would continually return "false" if the following
> conditions were true:
> 
> 1. the browser you are testing with is set to NOT accept cookies,
> 
> AND
> 
> 2. you are not encoding your URL's in which case Tomcat can not manage
> sessions using URL rewriting, e.g. you should be doing the following in
your
> .jsp files :
> 
> <a href=<%=response.encodeURL("page1.jsp")%>>Page 1</a>
> 
> 
> - Charlie
> 
> 
> On Wednesday 13 February 2002 07:08 am, Zhiyong Li wrote:
> > I posted the following message a while ago and have not got any
> > response. So, I tried it on tomcat 4.0.2 release. However, I got the
> > same result. I would appreciate your help.
> >
> > >2. I am trying to use isNew() method on session to detect whether a
> > >session is newly created or not. For example,
> > >
> > >           HttpSession session = request.getSession();
> > >
> > >           if (session.isNew()) {
> > >                   // do something
> > >           }
> > >
> > >However, session.isNew() always returns "false". I tried several other
> > >combinations such as: request.getSession(true) and I got the same
> > >result.
> > >
> > >Are these two known problems or anything I am missing?
> >
> > Zhiyong Li
> > Analytical Solutions, SAS Institute
> > (919) 653-2746
> > [EMAIL PROTECTED]
> 
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to