What is the best way to know whether the currently logged-in user has ‘remember-me’ (IsPersistent
) currently active?
I’m using older C# / .NET (not Core) and authenticating users with the SigninManager.PasswordSignInAsync
and passing the IsPersistent
parameter to set the relevant property of the auth cookie. The Remember-Me feature is working fine.
I now need to communicate with another system’s API and pass on whether or not the user logged in with Remember-Me.
So I’d ideally be able to check directly, similar to IsAuthenticated
, or is there a way to use the authentication cookie from the Request and decrypt to extract that information, etc. I found an example of extracting from the cookie for Forms Authentication but I don’t see a similar thing for when using Identity.
I was going to try code from here… /a/53769015 but that only has async functions and one of the places I need the value is an overloaded class that is difficult (maybe impossible) to make async.
My understanding and terminology might not be quite right, this not my original code and authentication is not my strong area, so please bear with any errors or misunderstandings in here – I’m willing to be educated!