Skip to content

Commit 7f4c4f0

Browse files
authored
Add isPersistent flag to cookie (#7127)
1 parent 735fef7 commit 7f4c4f0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/NuGetGallery/Authentication/AuthenticationService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Threading.Tasks;
1111
using System.Web.Mvc;
1212
using Microsoft.Owin;
13+
using Microsoft.Owin.Security;
1314
using NuGet.Services.Entities;
1415
using NuGetGallery.Auditing;
1516
using NuGetGallery.Authentication.Providers;
@@ -245,7 +246,7 @@ public virtual async Task CreateSessionAsync(IOwinContext owinContext, Authentic
245246
ClaimsIdentity identity = CreateIdentity(authenticatedUser.User, AuthenticationTypes.LocalUser, await GetUserLoginClaims(authenticatedUser, wasMultiFactorAuthenticated));
246247

247248
// Issue the session token and clean up the external token if present
248-
owinContext.Authentication.SignIn(identity);
249+
owinContext.Authentication.SignIn(new AuthenticationProperties() { IsPersistent = true }, identity);
249250
owinContext.Authentication.SignOut(AuthenticationTypes.External);
250251

251252
_telemetryService.TrackUserLogin(authenticatedUser.User, authenticatedUser.CredentialUsed, wasMultiFactorAuthenticated);

0 commit comments

Comments
 (0)