Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpSession

 
Parth Twari
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Source: Marcus quiz

Data in a HttpSession attribute will not be available if the web server restarts
true or false?
Answer: false

Explaination: Although session attribute data may dissapear if Tomcat is restarted, this is not guaranteed behaviour and some web servers may store session data in a database.

What does the spec say?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2778
174
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the spec say?

There is no requirement in the specs that say that the session information should be kept when the server goes down. So you are lucky (or not) if it is still available....

Regards,
Frits
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, it's up to implementing the container? Then we nee to know this, that there are some container will restore the session and some are not. Please confirm!
 
Parth Twari
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, tomcat does not store sessions others may decide to store them in a database while they are restarted.
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then, what about the browser side? Is it also depends on the browser?
 
Parth Twari
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


On browser its not about HttpSession its about cookies or about rewritten urls in the links you click.

So you can set your browser about how to deal with cookies and in case of links once the page is gone the appended jsessionid is gone as well.
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea, thanks Parth, in browser side, it's cookie! Thanks!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!