From 49ae66506ab3a3f5a661015332e42fa2fbde63c2 Mon Sep 17 00:00:00 2001 From: Chris R Date: Thu, 23 Mar 2017 10:22:13 -0700 Subject: [PATCH] #36 Proper time zone conversion for persistent cookies --- .../CookieAuthenticationHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Owin.Security.Cookies/CookieAuthenticationHandler.cs b/src/Microsoft.Owin.Security.Cookies/CookieAuthenticationHandler.cs index fec05b87..ecabe54d 100644 --- a/src/Microsoft.Owin.Security.Cookies/CookieAuthenticationHandler.cs +++ b/src/Microsoft.Owin.Security.Cookies/CookieAuthenticationHandler.cs @@ -181,7 +181,7 @@ namespace Microsoft.Owin.Security.Cookies if (signInContext.Properties.IsPersistent) { DateTimeOffset expiresUtc = signInContext.Properties.ExpiresUtc ?? issuedUtc.Add(Options.ExpireTimeSpan); - signInContext.CookieOptions.Expires = expiresUtc.ToUniversalTime().DateTime; + signInContext.CookieOptions.Expires = expiresUtc.UtcDateTime; } model = new AuthenticationTicket(signInContext.Identity, signInContext.Properties); @@ -252,7 +252,7 @@ namespace Microsoft.Owin.Security.Cookies if (model.Properties.IsPersistent) { - cookieOptions.Expires = _renewExpiresUtc.ToUniversalTime().DateTime; + cookieOptions.Expires = _renewExpiresUtc.UtcDateTime; } Options.CookieManager.AppendResponseCookie(