I am trying to understand the singleton lifetime in the context of DI in ASP.NET Core.
First, from what I can see a Singleton instance will be available "across application lifetime." But what does "application lifetime" mean? If it's a website and if a user logs in, singleton created first and user logs out and comes back in to the site after a few hours and logs back in will that user gets the same singleton instance? what about multiple users? Can multiple users get the same singleton instance?
Second, When does application lifetime end in .NET Core? Most articles talk about registering for application shutdown events. But what triggers an application shutdown? Is it always external events like IISreset or a system shutdown? Or internal events like memory crash etc? If no resets or memory or any other issues, will it keep going forever?