diff options
Diffstat (limited to 'projecttemplates/WebFormsRelyingParty/Code/Utilities.cs')
-rw-r--r-- | projecttemplates/WebFormsRelyingParty/Code/Utilities.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs b/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs index a211cad..8a49703 100644 --- a/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs +++ b/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs @@ -52,7 +52,7 @@ namespace WebFormsRelyingParty.Code { public static void VerifyCsrfCookie(string secret) { var cookie = HttpContext.Current.Request.Cookies[csrfCookieName]; if (cookie != null) { - if (cookie.Value == secret) { + if (cookie.Value == secret && !string.IsNullOrEmpty(secret)) { // Valid CSRF check. Clear the cookie and return. cookie.Expires = DateTime.Now.Subtract(TimeSpan.FromDays(1)); cookie.Value = string.Empty; |