Updates to login cookies

This commit is contained in:
hartvig
2012-08-09 11:15:55 -02:00
parent bb4f4822d4
commit 3acfb2a9ea
2 changed files with 11 additions and 1 deletions

View File

@@ -234,6 +234,12 @@ namespace umbraco.BasePages
{
// we swallow this type of exception as it happens if a legacy (pre 4.8.1) cookie is set
}
catch (ArgumentException ex)
{
// we swallow this one because it's 99.99% certaincy is legacy based. We'll still log it, though
Log.Instance.AddException(ex);
}
}
return "";

View File

@@ -354,6 +354,8 @@ namespace umbraco.BusinessLogic
public void SetValue(string value)
{
HttpCookie cookie = new HttpCookie(_key, value);
if (GlobalSettings.UseSSL)
cookie.Secure = true;
if (!TimeSpan.Zero.Equals(_expires))
cookie.Expires = DateTime.Now + _expires;
ResponseCookie = cookie;
@@ -378,7 +380,9 @@ namespace umbraco.BusinessLogic
public void SetValue(string value, DateTime expires)
{
HttpCookie cookie = new HttpCookie(_key, value);
cookie.Expires = expires;
if (GlobalSettings.UseSSL)
cookie.Secure = true;
cookie.Expires = expires;
ResponseCookie = cookie;
// original Umbraco code also does this