----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

> Hi,
> 
> I am not sure that i am corect but i allways use session like this:
> 
> /*
> looking for an allready created session
> */
> HttpSession session=req.getSession(false);
> if(session==null) session=req.getSession(true); /*create the session*/
> 
> 
> I think that calling req.getSession(true) will create a new session.
Yes.

> Am i wrong ??
IMHO No.

But why not spare your if-line and write 
HttpSession session = req.getSession (true);
without your overhead?
When you want to know wether your session is new or not, just ask.
session.isNew (); // returns boolean

Regards

Clemens Viehl


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to