I have a custom ASP.NET session manager class as follows:
public sealed class SessionManager : Page
{
private const string USER = "User";
private static readonly SessionManager _instance = new SessionManager();
private SessionManager()
{
}
public static SessionManager Instance
{
get { return _instance; }
}
public User User
{
get { return Session[USER] as User; }
set { Session[USER] = value; }
}
}
After a user successfully logs into the system his full name is displayed on the Home page. Below is the problem I am facing:
1) I first log into the system as John and John's full name is displayed on the homepage and the corresponding user object is kept in session.
2) Now from a different PC I login to the system as Mark. Now Mark's full name is displayed on the homepage and the corresponding user object is kept in session.
3) Now when I go to the PC from which John has logged in and refresh the homepage I see Marks name instead of Johns name.
What could be the reason for this strange behavior?