• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with using session attributes

 
Mandar Velankar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing one problem with using session in my shopping cart application.
Our organisation running one shopping cart site ,which is accessible on internet and intranet (within organisation).Problem is as follows,
We are tracking users details once it sign in into our site such as his/her
user id, its party name,its type(e.g dealer,distributor) etc through HttpSession by setting attriubutes( by using session.setAttribute()), but problem is when user logs in he/see doesn't see right information e.g his/her party name on first page / further pages, it is observed that if that page is refreshed 4-5 times , right party name get displayed.

I think there is some problem in session tracking/setting attributes in session.

Can anybody help me please?

Thanks a lot. Waiting for your reply.

Regards,

Mandar Velankar
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to say what the problem could be without seeing your code.

My first hunch is that it's a browser caching issue.
Have you added any no-cache headers or meta tags to the pages?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Second hunch is that you've written non-thread-safe code. If it turns out not to be a caching issue, check to make sure that your servlets contain no instance members and that your JSPs use no Java declarations.
 
Mandar Velankar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks all of you for your reply, there was problem with caching of pages,

I added following code and my problem get solved here.

response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setHeader("Expires", "0");

Thanks once again for your valuable suggestions.

Regards,
Mandar Velankar
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!