GeeCON Prague 2014*
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
Author

HttpSession()

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
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The first place I would go to check this is the API:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html#getSession()
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html#getSession(boolean)


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
GeeCON Prague 2014
 
subject: HttpSession()