Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Tomcat creating Httpsessions automatically

843841Nov 2 2007 — edited Jul 7 2008
In one of my servlets i have written the following code(TOmcat 6.0)

HttpSession session = request.getSession(false);

(i.e if already session is there then only give me back the session otherwise return null)

The above statement is always returning a session even though i have not created a session explicitly.It is never returning a null.

I assume Tomcat by default is creating session. Can we prevent TOmcat from creating the session automatically?

thanks
rama
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2008
Added on Nov 2 2007
9 comments
536 views