Originally posted by Cameron Park: Hi, I was wondering if a session is only specific for a browser. If we open up another browser in the same computer within the session's life time will another session be created?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
A Session is an object that can be associated with a request. This is an implicit object that you get for free in JSP. Now in order to get the behavior you want you need to understand what the session is really doing behind the scenes. If you understand what is happening then you can write your own mechanisms for tracking sessions. As mentioned above, the session object is real just setting cookies or rewritting URL's. The default behavior is setting cookies and if that is not available the URL is rewritten. Your applications behavior will be dependent on the browser. If the browser shares cookies with its other instances then their will only be one active session available using that browser. If you rewrite the URL (in theory you could code a mechanism that will POST the session id instead and get the same results) then the sessions will/can be seperate for each instance of the browser or even for different windows of the same instance of the browser. (I say CAN be different because I could cut and past the session id from one window into another and then have two windows with the same session) Obviously if you are running two completely different browsers, say netscape and IE, they don't share cookies and you will have two sessions. I hope this helps.
If you are using IE, opening a new window with File->New or Control->N will always open a browser with the same internal thread.. ie, the session id will be the same. If you open a new IE browser using the desktop icon, you will get a different id. For netscape, apparantly, multiple windows use the same internal thread.. So no matter how you open browser windows, all of them will share the same id.