Anyone who has implemented a "keep me signed in" functionality for customer sign in?

We reached out to Litium support and got some suggestions. We then managed to solve this by using the HttpContext

We first use the LoginService to sign in the user. We then use the HttpContext to first sign out and then sign in the user again. When using the methods on the HttpContext it is possible to set authentication properties, for example the expiration time at which the authentication ticket should expire.

await context.SignOutAsync(IdentityConstants.ApplicationScheme);
await context.SignInAsync(IdentityConstants.ApplicationScheme, context.User, new() { IsPersistent = true });