add a better explanation on the assumptions of the code, .NET mostly, but to review others. refer to https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html