views:

35

answers:

2

A strange issue.. and probably some key thing I am missing...

I am using the MS Enterprise Library version 5.0.. specifically the cache engine.

I have a website where from a certain page I do the following:

  1. Cache some values I need for the next page or two..
  2. Go off to another site - actually a payment site..
  3. That payment site returns to my site..
  4. I retrieve the cache values to show..

Ok, I know I am going to probably get shot here.. but apparently on the "odd" occasion, a user says they see the details from a previous user?

I thought when you cache an item (session, cache or whatever), this is only relative to the users session?

Anybody had this issue?

+2  A: 

Cache items are shared among all users. Session items are specific for a user (or to be more precise a user's session).

Checkout the descriptions here for further information on the various ASP.NET state management techniques.

PHeiberg
Wow, thanks for the quick reply!Oh dear.. I have obviously miss understood cache.. crikey!Thanks for the feedback!!
David S
+3  A: 

You should use caching for general information, for example; city list for your country, you do not have to get city list from your database on each page. You can cache list for all users. So, you should use Session for personal information.

NetSide
Thank you.. as mentioned, I really have mis-calculated how cache vs session is used :(
David S