aspnet/DataProtection

Random "Accessing expired session" warning

Closed this issue · 2 comments

Hi, I have an application without Authentication.
All the user data is passed by an external portal via http headers on the first request, and I store it in Session.
I have configured the DistributedCache and Session services this way:
services.AddDistributedMemoryCache();
services.AddSession(o => o.IdleTimeout = TimeSpan.FromMinutes(20));

During navigation, the application sometimes loses the session way before the IdleTimeout, and checking the log I can see the “Accessing expired session” warning.

The problem is that it does not happen all the time, it’s totally random. The issue may happen once after 10 correct responses, or it may fail 10 times before succeeding.

It happens only after an Ajax call that returns a big amount of data (JSON format) that is rendered inside a Kendo UI Grid, but the Ajax call is always processed correctly, so there is no way for me to understand if during the next request I will get the "Accessing expired session" warning or not.

It looks like I'm missing a piece of configuration, but no matter what i adjust I still get the same warning with the same random frequency.

This looks similar to aspnet/Session#160. Can you explain how this is related to DataProtection APIs? The session component for ASP.NET Core is found here: https://github.com/aspnet/Session

Sorry, I opened a new issue here without realizing where I was. I was here reading #189, which may be related, but was not focusing on my problem.

Sorry, I'm closing this one.