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

Commit

Permalink
VDS-1067: Disable HttpOnly attribute on auth cookie and increase cook…
Browse files Browse the repository at this point in the history
…ie life time (#61)

* VDS-1067: Disable HttpOnly attribute on auth cookie

* Fix code smell

* Increase cookie life to thirty days

* Fix settings
  • Loading branch information
asvishnyakov committed Mar 18, 2021
1 parent 389a26c commit a3a50eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VirtoCommerce.Storefront/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
using VirtoCommerce.Storefront.Model.Tax.Services;
using VirtoCommerce.Storefront.Routing;
using VirtoCommerce.Tools;
using SameSiteMode = Microsoft.AspNetCore.Http.SameSiteMode;

namespace VirtoCommerce.Storefront
{
Expand Down Expand Up @@ -264,6 +263,7 @@ public void ConfigureServices(IServiceCollection services)
services.ConfigureApplicationCookie(options =>
{
Configuration.GetSection("CookieAuthenticationOptions").Bind(options);
options.Cookie.HttpOnly = false;
options.EventsType = typeof(CustomCookieAuthenticationEvents);
});

Expand Down
2 changes: 1 addition & 1 deletion VirtoCommerce.Storefront/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"Cookie": {
"HttpOnly": true
},
"ExpireTimeSpan": "00:30:00",
"ExpireTimeSpan": "30.00:00:00",
"LoginPath": "/Account/Login",
"LogoutPath": "/Account/Logout",
"AccessDeniedPath": "/error/AccessDenied",
Expand Down

0 comments on commit a3a50eb

Please sign in to comment.