• Post Reply Bookmark Topic Watch Topic
  • New Topic

setMaxInactiveInterval not giving result as expected

 
juanschodiger jha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Above code supposed to throw runtime illegal state exception as parameter to session.setMaxInactiveInterval(0) method passes as 0
so it should get invalidate as soon as created.But i am getting output as 42.
Can anybody explain me reason for getting same output.
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the Javadocs:
An interval value of zero or less indicates that the session should never timeout.

If you want to timeout the session immediately, use invalidate(). You won't be able to retrieve the attribute value afterwards though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!