Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Same user different browser window ? new seesion or old one?

 
Adam Zedan
Ranch Hand
Posts: 124
C++ Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i just started servlets using "Head first JSP and servlets" awsome book by the way.. Though i have a question... I was going over the session chapter in which we determined whether it was a new session or an old one using




my question is if the same user opens another browser window ad makes a request on the same servlet will that be considered as a new session or an old one
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on the browser (and I suspect the version of the browser.) New tabs are definitely not new sessions. For separate windows, it depends on the implementation on the browser end. I recommend trying it for the browser you are interested in.
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying is the best idea, but you can assume that it's the same session.

Definitely assume so for the exam, because it means that session attributes are NOT thread safe. Even though there is a session per user, the same user can concurrently alter his session state. You will find that mentioned in HFSJ as well, I assume it's in a later chapter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic