aspnet / AspNetSessionState

ASP.NET Session State (not for ASP.NET Core)
MIT License
55 stars 43 forks source link

Existing record is ok when creating uninitialized state item. #81

Closed StephenMolloy closed 1 year ago

StephenMolloy commented 1 year ago

When we call CreateSessionStateItem to create an uninitialized state item, we do so solely to ensure the item exists so future calls to GetStateItem can successfully take a lock on it. It does not really matter what the contents of the item are (although the potential race condition here has two separate requests racing to create an uninitialized item, so the already existing item should also be "uninitialized"... but it doesn't really matter because we don't care what the contents are when we return, so long as it exists and we can lock it and overwrite it later.)