We are setting session-timeout for 1 hour:
<system.web>
<sessionState mode="InProc" timeout="60"/>
</system.web>
It works as expected.
Alongwith "Session", we create user specific data-cache to reuse the data.
We use unique cache-key for each logged in user:
var studentId = GetStudentIdFromRequest();
var cacheKey = "SyllabusInfoCacheKey_" + studentId;
We set the expiration time of cache as:
Cache.Insert("MyKey", myObject, null, DateTime.Today.AddDays(1), TimeSpan.Zero);
But I need to remove the user specific data-cache once the session gets timeout.
Kindly help me out.
Put below code in Global.asax file in your project.
Please put this code in you vb file where you are assigning session.
Note: convert this code in C# if you are not using vb.