Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Raise the CookiePolicy consent cookie lifetime to one year #1589
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher committed Jan 26, 2018
1 parent a940b6e commit ab8328a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -30,7 +30,7 @@ public class CookiePolicyOptions
public CookieBuilder ConsentCookie { get; set; } = new CookieBuilder()
{
Name = ".AspNet.Consent",
Expiration = TimeSpan.FromDays(90),
Expiration = TimeSpan.FromDays(365),
IsEssential = true,
};

Expand Down
Expand Up @@ -221,6 +221,8 @@ public async Task GrantConsentSetsCookie()
var consentCookie = cookies[0];
Assert.Equal(".AspNet.Consent", consentCookie.Name);
Assert.Equal("yes", consentCookie.Value);
Assert.True(consentCookie.Expires.HasValue);
Assert.True(consentCookie.Expires.Value > DateTimeOffset.Now + TimeSpan.FromDays(364));
Assert.Equal(Net.Http.Headers.SameSiteMode.Lax, consentCookie.SameSite);
Assert.NotNull(consentCookie.Expires);
var testCookie = cookies[1];
Expand Down

0 comments on commit ab8328a

Please sign in to comment.