Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with session management

 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When I login into some web application(with websphere) and capturing user id and putting that user info into session. It works well for one browser. If I open another browser and log into the application, instead of creating new session, my server is overriding existing session with new user.
What can be possible reasons for this?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64985
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the browser instances share cookies, the sessions will be shared.
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I know whether browser instances share cookie or not? Is there any way to set this from browser?
Interestingly this happens only in my real websphere server not from my local machine test server. Is this setting should be set from server side?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64985
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, there is no server-side setting. The browsers each have there own rules about cookie sharing.

IE, for example, will share cookeies amongst all instance spawned from a window (either through window.open, or the user using ^N or the File menu). Instance created from the desktop icon or strat menu will not. Go figure.
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats what I thought initially. But it is sharing same session even though IE is creted newly from start menu.Any idea why it is happening?
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From different browser instances it gives different JSESSIONID cookie but they have same session id(request.getSession.getID()). First IE returns session as new but second instance returns sesssion as old(session.isNew() == false).
What are the scenarios, in which this case can happen?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic