summaryrefslogtreecommitdiffstats
path: root/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs
diff options
context:
space:
mode:
Diffstat (limited to 'projecttemplates/WebFormsRelyingParty/Code/Utilities.cs')
-rw-r--r--projecttemplates/WebFormsRelyingParty/Code/Utilities.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs b/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs
index 8a49703..25d293e 100644
--- a/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs
+++ b/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs
@@ -12,7 +12,7 @@ namespace WebFormsRelyingParty.Code {
using System.Web;
public static class Utilities {
- private const string csrfCookieName = "CsrfCookie";
+ private const string CsrfCookieName = "CsrfCookie";
private static readonly RandomNumberGenerator CryptoRandomDataGenerator = new RNGCryptoServiceProvider();
/// <summary>
@@ -38,7 +38,7 @@ namespace WebFormsRelyingParty.Code {
string secret = Convert.ToBase64String(randomData);
// Send the secret down as a cookie...
- var cookie = new HttpCookie(csrfCookieName, secret) {
+ var cookie = new HttpCookie(CsrfCookieName, secret) {
Path = HttpContext.Current.Request.Path,
HttpOnly = true,
Expires = DateTime.Now.AddMinutes(30),
@@ -50,7 +50,7 @@ namespace WebFormsRelyingParty.Code {
}
public static void VerifyCsrfCookie(string secret) {
- var cookie = HttpContext.Current.Request.Cookies[csrfCookieName];
+ var cookie = HttpContext.Current.Request.Cookies[CsrfCookieName];
if (cookie != null) {
if (cookie.Value == secret && !string.IsNullOrEmpty(secret)) {
// Valid CSRF check. Clear the cookie and return.