diff --git a/BTCPayServer/Controllers/UIAccountController.cs b/BTCPayServer/Controllers/UIAccountController.cs index ce1526358..b58f7e2e2 100644 --- a/BTCPayServer/Controllers/UIAccountController.cs +++ b/BTCPayServer/Controllers/UIAccountController.cs @@ -605,6 +605,7 @@ namespace BTCPayServer.Controllers public async Task Logout() { await _signInManager.SignOutAsync(); + HttpContext.DeleteUserPrefsCookie(); _logger.LogInformation("User logged out."); return RedirectToAction(nameof(UIHomeController.Index), "UIHome"); } diff --git a/BTCPayServer/Extensions.cs b/BTCPayServer/Extensions.cs index ab911f557..a83c3986d 100644 --- a/BTCPayServer/Extensions.cs +++ b/BTCPayServer/Extensions.cs @@ -425,6 +425,11 @@ namespace BTCPayServer return prefCookie; } + public static void DeleteUserPrefsCookie(this HttpContext ctx) + { + ctx.Response.Cookies.Delete(nameof(UserPrefsCookie)); + } + private static void SetCurrentStoreId(this HttpContext ctx, string storeId) { var prefCookie = ctx.GetUserPrefsCookie();