adds null check to session id - might not exist in old cookies

This commit is contained in:
Shannon
2016-02-02 18:01:36 +01:00
parent 22689d24ec
commit b2cd5dfb85

View File

@@ -210,7 +210,7 @@ namespace Umbraco.Core.Security
if (HasClaim(x => x.Type == ClaimTypes.Locality) == false)
AddClaim(new Claim(ClaimTypes.Locality, Culture, ClaimValueTypes.String, Issuer, Issuer, this));
if (HasClaim(x => x.Type == Constants.Security.SessionIdClaimType) == false)
if (HasClaim(x => x.Type == Constants.Security.SessionIdClaimType) == false && SessionId.IsNullOrWhiteSpace() == false)
{
AddClaim(new Claim(Constants.Security.SessionIdClaimType, SessionId, ClaimValueTypes.String, Issuer, Issuer, this));