• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to create more than one HttpSession in our Application

 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What will happen if i

HttpSession sess1 = request.getSession(true);

HttpSession sess2 = request.getSession(true);

Will the Container will create two sessions for a Thread Request??
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked what HttpSession#getId() says?
Have you read the HttpSession API doc at any way?

http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSession.html
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Each request can be assigned only to one session !!
So the second call to request.getSession(true); will actually return the same session created in the first statement.
 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Balu Sadhasivam ,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic