Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #11 from mehrdada/master

Fix cookie persistence issue. (Issue #10)
  • Loading branch information...
commit 923e33c5c8d8d57442b331a116acc8dacd43b22d 2 parents 2da2c51 + e77596e
@runesoerensen runesoerensen authored
View
2  AppHarbor.Web.Security/AuthenticationCookie.cs
@@ -110,7 +110,7 @@ public void Renew()
public bool IsExpired(TimeSpan validity)
{
- return !Persistent && _issueDate.Add(validity) <= DateTime.UtcNow;
+ return _issueDate.Add(validity) <= DateTime.UtcNow;
}
public DateTime IssueDate
View
2  AppHarbor.Web.Security/CookieAuthenticationModule.cs
@@ -69,7 +69,7 @@ private void RenewCookieIfExpiring(HttpContext context, CookieProtector protecto
HttpOnly = true,
Secure = _configuration.RequireSSL,
};
- if (!authenticationCookie.Persistent)
+ if (authenticationCookie.Persistent)
{
newCookie.Expires = authenticationCookie.IssueDate + _configuration.Timeout;
}
View
2  AppHarbor.Web.Security/CookieAuthenticator.cs
@@ -29,7 +29,7 @@ public void SetCookie(string username, bool persistent = false, string[] roles =
HttpOnly = true,
Secure = _configuration.RequireSSL,
};
- if (!persistent)
+ if (persistent)
{
httpCookie.Expires = cookie.IssueDate + _configuration.Timeout;
}
Please sign in to comment.
Something went wrong with that request. Please try again.