i have problem to get / set the Session variable inside c# classes, its working with MVC actions / asp.net forms but not working with other than Form / MVC Controller classes.
i used this way
System.Web.HttpContext.Current.Session["connectioncount"] = 6;
int a = (int)System.Web.HttpContext.Current.Session["connectioncount"];
reference i used this help
Problem: i need to set / get session variable value in 1 class other than MVC controller class and also access this Session variable value in Library / other 2 class. or i need a variable which will be used through out the application but for each users it will have different values and will clear / set to default when user will disconnect app. its web app
can any one help me, i find more solutions but have problem to use them. i appreciate your valuable time. thanks in advance.