We have a bug that we are trying to fix. It looks like one user can see another users data it they hit the same aspx page at the same time.
I was wondering: If we store data in a property on the master page, will all pages running at the same time see that data.
Have a master page:
public class MyMasterBase : System.Web.UI.MasterPage
{
private int myInt;
}
Create reference to master page from the aspx page:
MyMasterBase master = Page.Master as MyMasterBase;
Two users then call the aspx page at the same time:
- The first user sets myInt to 1
- The second user sets myInt to 2
- If the first user reads the myInt value what will it be?
I expect that it would be 1, but if it was 2 it would explain our bug 🙂
Thanks
Shiraz
Sounds like a cache problem to me. MasterPages don’t persist data between sessions, but the Cache will. Find everywhere in your project that you’re putting information into the Cache and ensure no user or session-specific data is going into it. Cache should only hold information that applies to all users at a given time.