File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes HttpSession() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpSession()" Watch "HttpSession()" New topic


Chidanand Chauhan
Ranch Hand

Joined: Nov 10, 2005
Posts: 77
If we use

HttpSession session=request.getSession();

Then it will return the new session whether there is any other pre-existing session or not.

If i do

HttpSession session=request.getSession(false)

then itwill return either null or the pre-existing session.

I suppose.
Please comment whether i am right or not...................
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

The first place I would go to check this is the API:

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: HttpSession()
It's not a secret anymore!