Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

getsession(false)  RSS feed

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

getSession(false), is returning an existing session and null if nothing is available, if that is the case, then creating a session in normail way, i.e.
HttpSession session = request.getSession();
HttpSession session = request.getSession(true);
in both the above ways, it is always creating a new session, so if we call isNew() on the session object then we should always get true, and if its always true, then how can we maintain session?

Regards,
Sri.
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

in both the above ways, it is always creating a new session



No, request.getSession() will first check if its existing session, then it will return that otherwise will create new one.
[ March 21, 2007: Message edited by: Ali Gohar ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!