• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session.isNew()

 
M Rama
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If cookies are enabled on a browser, the following code is this always going to return false? Why?
 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when we say request.getSession () a sesion is returned with a session id associated with it. then you send the response back and if user has cookies enabled then calling isNew () will always return false because the session was created when you said request.getSession () in your servlet code.
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the first time you create session the isNew() will return true.
Not always return false.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic