• Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpSession mixup (user 1 sees user 2 data)

 
Ron Jerman
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have an application that uses HttpSession for session managment. Its a struts application. We have an issue where if two users login at the same time, precise to the milliseconds, their data gets mixed up. Does anyone have any clues?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Is the code you're using not thread-safe by any chance?
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Elaborating a little on Ulf's comment.
I think its not the HTTPSession that is the culprit but its the objects stored in the session.
Just see whether the data that is getting mixed up is shared between two requests. i.e. , you do something like this:

Client 1 uses DataObjectFactory to get DataObject1
Client 2 uses DataObjectFactory to get the same object DataObject1

you store DataObject1 in session.
Client 1 modifies DataObject1 and client 2 uses the same.
[ May 24, 2007: Message edited by: Nitesh Kant ]
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Watch for any use of static variables also (presuming there use hasn't been thought through ;-) )
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!