This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
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
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.
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.