File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Server caching problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Server caching problem" Watch "Server caching problem" New topic

Server caching problem

Alenka Shtykel

Joined: Oct 24, 2003
Posts: 16
I am currently working on development of an application in jsp/java. However, I have a problem, which I am not sure how to solve. If I open two browsers on the same computer and login into application as two different users, after some clicks, one of the users becomes the other user. In other words, both browsers will now display his or her name at the top.. and both will have access to the same functionality. This is very dangerous as I want to restrict certain users from accessing certain functions. Refreshing the page doesn't work, so I was thinking that maybe it's a server-side caching. Does anyone have any ideas? Please help! Thank you very much.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

This is most likely because the browser instances are sharing cookies. Since a cookie is used to maintain the session, the instances are getting their sessions confused.
IE is strange in that some browser instances share cookies, and others do not. It all depends on how you spawned the instances.

[Asking smart questions] [About Bear] [Books by Bear]
Alenka Shtykel

Joined: Oct 24, 2003
Posts: 16
What can I do so that sessions were not getting confused? Has anyone ever encountered this problem. Thanks!
Wally Schnok

Joined: May 31, 2001
Posts: 29
the problem is how do you do to maintain sessions ?!
if using cookies could happen what Bear said .....
in other cases, is just strrrrraaaaaaaaaaaaange , there is a problem in your architecture , try to put in session the userId logged any page after checking the user logged value in session :-)))
I agree. Here's the link:
subject: Server caching problem
jQuery in Action, 3rd edition