• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session attr. thread safety  RSS feed

 
mohsin sheikh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I m, having an application and i have problem in session attribute thread safety.I m opening the same application from the two same browser window(say--Mozilla) and accessing the same application.Now the problem is that when i do something on first browser then the changes will be reflected on another.I got the solution also that to synchronize the session object.
But i m setting a session attribute in one servlet and getting it in other servlet,then my question is how to synchronize the session object then
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depending on how you've opened the browsers, it is possible that two of them could be sharing the same cookie space; which means they will both use the same session on the server. Synchronizing won't help in this case.

Now, if you're seeing the same data in two different types of browsers (mozilla and MSIE for instance) then this doesn't sound like a session problem. It sounds like you're either using application scope improperly or you're using instance variables in your servlets.

Please describe the problem in a little more detail and maybe someone can give you some more advise.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!