Is there a session start equivalent in .Net Core MVC 2.1?
问题 In MVC 5 you could assign a value to session in global.asx when the session started. Is there a way you can do this in .Net Core MVC? I have session configured but in the middleware it seems to get called on every request. 回答1: nercan's solution will work, but I think I found a solution that requires less code and may have other advantages. First, wrap DistributedSessionStore like this: using System; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Session; using Microsoft