• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Doubt, Mock exam on page 265 (Session management), 5 question.

 
Mateus Lucio
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone explain me why this option is correct please!?

Option D: When using cookies for session tracking, the name of the session tracking cookie must be jsessionid.

I can understand if all the web containers that support servlets and jsps use a cookie named jsessionid but i can't understand why the cookie MUST have this name.

I couldn't find a place that says that, and the HFSJ errata doesn't have anything mentioning that question. Could someone help me on that please?

Thank you all !!


 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web containers will look for that cookie, so we need to use the same name for everybody. Otherwise how would the container know which cookie to look for ?
 
Mateus Lucio
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't the Web Container that writes this cookie? or it's written by java API?
I mean, if it's container job to write that cookie and it's also his job to read it, then any name could be used like, "tomcatseessionid" or "jettysessionid" or "iissessionid" as long as he understands what he has written, I don't see why the cookie must be named "jsessionid".

I know that this matter isn't so important, I just couldn't not ask it!!
 
Chinmaya Chowdary
Ranch Hand
Posts: 432
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Mateus. I think it is due to compatablity between the servers, especially in clustering environment, where different server's work together(when session needs to migrate from one server to another server). Thankyou.
 
Mateus Lucio
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!!!

That makes sense ... when you deploy a web app in a clustered environment, you don't need (or sometimes you can't) to use the same web container in all machines, if you don't use the same cookie name your session info couldn't be transferred from one node to another!


Thanks again!!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic