When I open two applications in different browsers or in the same browser, the value which I added in one application is visible to the other application.
I have made a session helper but i am still in problem.
public class SessionHelper
{
#region Strongly typed variable
public static CreateAccountModel tmpmodel = null;
public static string errMsg = string.Empty;
public static List<PointOfSalesModel> CurrPosModelArr = null;
public static List<PointOfSaleUsersModel> currAddedClerks = null;
public static List<AuthorizedIPsModel> currAddedIPs = null;
public static bool isPosDataLodedFirstTime = false;
public static string isEditGridClickedVal = "No";
public static int AccountId = -1;
#endregion
public SessionHelper Current
{
get
{
SessionHelper currentSession = HttpContext.Current.Session["_session"] as SessionHelper;
if (currentSession == null)
{
currentSession = new SessionHelper();
HttpContext.Current.Session["_session"] = currentSession;
}
return currentSession;
}
}
}
Static fields/properties are shared across all your requests made from browsers. So even though you save it to the session, but each
SessionHelperwill have same static fields referenced. Use instance fields instead.