I'm working on an ASP.NET project, and I'm having trouble getting session variables to work across the entire project. Specifically, I'm saving a value to the session like this:
Session["ConsumerId"] = lobjlogin.ConsumerId;
However, when I try to access this session variable in different parts of the project, it's not working as expected.

Amit MohantyPosted Jul 12, 2024, 1:28 PM
Please verify that cookies are enabled in your browser because session state relies on cookies. Also, ensure you are not accidentally clearing or abandoning the session, such as avoiding calls to Session.Abandon() or Session.Clear().
Ishika TiwariPosted Jul 12, 2024, 1:04 PM
i already did it but it's not working
Amit MohantyPosted Jul 12, 2024, 11:51 AM
Make sure that the session state is enabled in your web.config file: