Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP SESSION MANAGEMENT

 
Mahesh Eshwarappa
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
We have hosted an internet application lately. We have run into session problems. THe session of one user(client) is getting transferred to some other user(client).
Iam setting the session in the first page with an user id saying session.put(userid,somevalue)
And i check in each page whether this is the correct value.
Somehow the session id of one user is getting transferred to 2 to 3 users. Websphere is our JSP server.
Can anybody help on this....
Thanks,
Mahesh
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mahesh,
HOw did you test? By 'Somehow the session id of one user is getting transferred to 2 to 3 users' , do you mean, one user is able to see other user related data which are put in session?
If so it could be static/instance vars problem of servlets. If you want each user to have unique session data, those session objects must be local vars inside doGet or doPost in case of Servlet, NOT instance or static vars, since static and instance vars are shared between all user requests.
In case of JSP, they must be declared within <% %> tags NOT within <%! %> tags.
regds
maha anna
[This message has been edited by maha anna (edited March 26, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic