wood burning stoves 2.0*
The moose likes Servlets and the fly likes Same user different browser window ? new seesion or old one? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Same user different browser window ? new seesion or old one?" Watch "Same user different browser window ? new seesion or old one?" New topic
Author

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

Adam Zedan
Ranch Hand

Joined: Jun 10, 2011
Posts: 124

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


Don’t look where you fall, but where you slipped
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30973
    
159

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Dieter Quickfend
Bartender

Joined: Aug 06, 2010
Posts: 543
    
    4

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.


Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Same user different browser window ? new seesion or old one?