dotnet/aspnetcore
LoadAsync on Session - when _isNewSessionKey is true
Aperta
#20.898 aperta il 16 apr 2020
Perfaffected-fewarea-middlewarebreaking-changeenhancementhelp wantedseverity-nice-to-have
Metriche repository
- Star
- (37.933 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Should Load/LoadAsync be a no-op when _isNewSessionKey is true. Taking the advice to call LoadAsync prior to accessing the session with get/trygetvalue/set I would of thought we'd guard against unnecsssary chitchat to the cache if we know the session is new?
I though about doing Request.Cookies["sesscoookie"] != null then await LoadAsync but then doing Get/Set/Id/IsAvailable will simply call load anyway if not _loaded isnt marked.