Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

new session while refreshing the page.

 
prateekprateek narang
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi group,
i've one login.jsp file where i'm creating a new session and setting the inactive time to 10 seconds. the code for this is


after that i forward the page to test1.jsp

my problem is that when i reach this test1.jsp page and leave it inactive for 10 seconds and then refresh, it prints "making new session". could any body tell me why it happens???
i also have test2.jsp. and i reach on this file by clicking on the anchor provided in test1.jsp.

which shows the perfect results. why it happens at one file while another file shows the perfect results.
--regds--
--prateek--
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure that I understand what your problem is, but in the first case, the session is new because it was just created. The isNew method returns true which the ! reverses so you see the else output "making new session".
The session won't be considered "old" unless it has been recovered by the servlet engine using a cookie from the browser.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic