From c8f918681a9224b56c975fdbb97451d7aced6f7d Mon Sep 17 00:00:00 2001 From: Chris R Date: Thu, 20 Aug 2015 13:54:07 -0700 Subject: [PATCH] React to string[] -> StringValue changes. --- .../SessionMiddleware.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Microsoft.AspNet.Session/SessionMiddleware.cs b/src/Microsoft.AspNet.Session/SessionMiddleware.cs index 9dee803d72..4eeb183bd2 100644 --- a/src/Microsoft.AspNet.Session/SessionMiddleware.cs +++ b/src/Microsoft.AspNet.Session/SessionMiddleware.cs @@ -55,7 +55,7 @@ namespace Microsoft.AspNet.Session { var isNewSessionKey = false; Func tryEstablishSession = ReturnTrue; - var sessionKey = context.Request.Cookies.Get(_options.CookieName); + string sessionKey = context.Request.Cookies[_options.CookieName]; if (string.IsNullOrWhiteSpace(sessionKey) || sessionKey.Length != SessionKeyLength) { // No valid cookie, new session. @@ -129,17 +129,9 @@ namespace Microsoft.AspNet.Session _context.Response.Cookies.Append(_options.CookieName, _sessionKey, cookieOptions); - _context.Response.Headers.Set( - "Cache-Control", - "no-cache"); - - _context.Response.Headers.Set( - "Pragma", - "no-cache"); - - _context.Response.Headers.Set( - "Expires", - "-1"); + _context.Response.Headers["Cache-Control"] = "no-cache"; + _context.Response.Headers["Pragma"] = "no-cache"; + _context.Response.Headers["Expires"] = "-1"; } // Returns true if the session has already been established, or if it still can be because the response has not been sent.