aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Two requests from two different browsers can be in same session?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Two requests from two different browsers can be in same session??" Watch "Two requests from two different browsers can be in same session??" New topic
Author

Two requests from two different browsers can be in same session??

Lavanya ch
Ranch Hand

Joined: Dec 16, 2004
Posts: 75
I'm reading HFSJ.I've got a doubt in session.
Here it is...

say I've requested for a url in browserA. and that application requires login of the user. if we choose New window from that browser, still we can proceed the application without logging again in the new window.

In this scenario, two requests from two different browsers(clients) are in the same session.

other than this, can there be any scenario ,where two different requests from two different browsers can be in same session??

Thanks in advance
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

Depends on the browser you are using. Try it on different browsers.

Thank


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Vikrant Pandit
Ranch Hand

Joined: Mar 27, 2006
Posts: 245
Hi,

Choosing a new window from an existing "Internet Explorer" creates the new window which is the child process of the existing window . They share all the properties and even cookies . Thats the reason you are able to login in the application using the new window .

HTH
Vivek


Vikrant Pandit
Lavanya ch
Ranch Hand

Joined: Dec 16, 2004
Posts: 75
Yes. I know that creating a new window in Internet explorer or opening a new tab in Firefox, creates the child.
but my doubt is other than this, is there any scenario where it happens??
Giovanni De Stefano
Greenhorn

Joined: Jul 18, 2006
Posts: 21
Lavanya,

I believe the session is local to the browser (client):
STEP 1: open Internet Explorer and login
STEP 2: open a new window in Internet Explorer (no login required)
STEP 3: open Firefox...you have to login

I tried this on Linux using 2 different browsers (Firefox and Konqueror).

The best is to try it out on your own!

I hope it helps,
Gio


SCJP 1.4
Giovanni De Stefano
Greenhorn

Joined: Jul 18, 2006
Posts: 21
This might help too...
Lavanya ch
Ranch Hand

Joined: Dec 16, 2004
Posts: 75
Thanks for the answer.
I've tried on Internet Explorer and Firefox on windows.
I found that it is not possible to be in the same session for 2 different requests.
but book says its possible.
i'll post the page number 2mr.
Giovanni De Stefano
Greenhorn

Joined: Jul 18, 2006
Posts: 21
Lavanya,

I think you misunderstood the book: the key is that you can be in the same session for 2 different requests, as long as the requests come from the SAME client (browser), this is the definition of session!

If the 2 requests come from different clients (different browsers), then each client (browser) needs to have its own session, though 2 different requests coming from 2 different clients (browsers) cannot be in the same session.

I hope this clarified the doubt.

Gio :-)
Lavanya ch
Ranch Hand

Joined: Dec 16, 2004
Posts: 75
Thanks Gio.
exactly i was stuck at that point.

"the same session for 2 different requests, as long as the requests come from the SAME client (browser)"

is there any case which replicates the above scenario??
kumari Jain
Ranch Hand

Joined: Jul 28, 2004
Posts: 44
This could possibly happen in the following scenario.

If you click on a link at a site which used URL rewriting(appending session id to the link),assume the new page is taking time to be displayed.

If you copy the URL present in the address bar and opened a new window ,pasted the URL,then the original request from the first window and the request from the second window would be a part of the same session .This is because their URLs have the same session id.

And of course you will have to disable cookies in your browser to see the session id in the url(and URL rewriting is also used in the page as well)

regards,
kumari
Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
"the same session for 2 different requests, as long as the requests come from the SAME client (browser)"


This means in the same IE you can hit more than one request. For example, if you login into Yahoo, you click on compose, checkmail, addresses, etc.. buttons being in the same browser. These are like different requests from same client or browser. All these share same session.

You can have same session for different browser instances also, if you make some setting in your server configuration. That is beyond the scwcd discussion.


Rizwan
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Two requests from two different browsers can be in same session??