• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session -Browser window

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Please validate my understanding:


1)Everytime a new Session gets created when a new browser window is opened on the same machine.

2)Session id /session remains same if user does: File->New Window from the IE browser window?
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1)Everytime a new Session gets created when a new browser window is opened on the same machine.



Yes,Everytime new session is created if that web developer is not done some coding to avoid that.
(e.g. Just Login to javarach in IE close IE from cross at right upper side and again open new IE browser see you are still login that means session is get maintained same for google's gmail)

Session id /session remains same if user does: File->New Window from the IE browser window?



yes it is same.
 
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Amarkirt. Everytime new session's will gets created, only when different new browser windows are opened on the same machine. New session's will not gets created, if we open with same type of windows.

The process is, if we open a gmail or yahoo or any application that use sessions internally, will creates session object, when a request comes, and encapsulated it into cookie object and will add to the response header and will sent to the client(browser). Now the browser is having cookie(inside it session id present). And everytime the browser will communicate to that site with this session id.

Suppose if we open gmail in two new windows of same type, like two firefox or windows IE, the gmail application will not create two different session objects. If a request made to gmail through firefox, the gmail application create session object and will sent to the firefox in the form of cookie. If we open the same gmail in different firefox window, the firefox uses the first cookie object. Already the session id sent to the firefox in the form of cookie. The two different firefox windows communicates to the gmail with same session id. The firefox uses that cookie everytime it needed to communicate, it is same incase of IE.

If we open the gmail one with firefox and another in IE, then the gmail application will create two different session objects, one for firefox and another for IE.
 
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Chinmaya , Great Explanation!!!
Keep up the good work!

When i opened Gmail and yahoo in the same browswer window (different tab) it was signed in.
Howevere when i opened a fresh IE window, I was not signed in.
That means Gmail and Yahoo are maintaining the session based on the browser window

However in case of Java ranch , I was logged in both the cases ( when i opened it in the same window (new tab) and even in a complete new IE window).
Does that mean it maintains its session based on the IP address or something and not on the browser window
And that different applications maintain session in different ways..

Just wanted to know if I am thinking on the right track...
 
Chinmaya Chowdary
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Nabila. Thankyou. JavaRanch follows different strategy, rather than providing unique session id. I think it will not made session's depending on IP address. Incase of private network, we have local IP addresses. The server will not send packets to local IP address system directly. It will first sent to the router(router maintain's a table containing the local IP address details), it is the job of router to send the packets to the system which made a request to server. To the server, IP address of the system is the IP address of the router. I think JavaRanch will not follow this strategy. I think it follows unique hardware installation key, every system will have unique key(I am not sure about this).
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes sense!!!

Thanks for the explanation.

Take care!
 
reply
    Bookmark Topic Watch Topic
  • New Topic