From dd74b38dcce0b6d5842c742b9fee37f56caa2947 Mon Sep 17 00:00:00 2001 From: msgavin Date: Fri, 11 Jan 2013 16:01:28 +0000 Subject: [PATCH 1/2] Update AppHarbor.Web.Security/CookieAuthenticator.cs Set the cookie domain on SignOut to fix the browser expiring the auth cookie. --- AppHarbor.Web.Security/CookieAuthenticator.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/AppHarbor.Web.Security/CookieAuthenticator.cs b/AppHarbor.Web.Security/CookieAuthenticator.cs index c3dd157..8f72a7a 100644 --- a/AppHarbor.Web.Security/CookieAuthenticator.cs +++ b/AppHarbor.Web.Security/CookieAuthenticator.cs @@ -50,6 +50,7 @@ public void SignOut() _context.Response.Cookies.Add(new HttpCookie(_configuration.CookieName, "") { Expires = DateTime.UtcNow.AddMonths(-100), + Domain = _configuration.Domain }); } From e3097ee763c0a410cc9031ee62242dcc213d8438 Mon Sep 17 00:00:00 2001 From: msgavin Date: Fri, 11 Jan 2013 16:03:51 +0000 Subject: [PATCH 2/2] Update AppHarbor.Web.Security/SymmetricEncryption.cs Removed the rng.Dispose call, as the RNG is not disposable in .net2 and this causes a compile error. --- AppHarbor.Web.Security/SymmetricEncryption.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/AppHarbor.Web.Security/SymmetricEncryption.cs b/AppHarbor.Web.Security/SymmetricEncryption.cs index e376351..b3713a0 100644 --- a/AppHarbor.Web.Security/SymmetricEncryption.cs +++ b/AppHarbor.Web.Security/SymmetricEncryption.cs @@ -33,17 +33,7 @@ public override byte[] Encrypt(byte[] valueBytes, byte[] initializationVector) { initializationVector = new byte[_algorithm.BlockSize / 8]; var rng = RandomNumberGenerator.Create(); - try - { - rng.GetBytes(initializationVector); - } - finally - { - if (rng != null) - { - ((IDisposable)rng).Dispose(); - } - } + rng.GetBytes(initializationVector); } using (var output = new MemoryStream())