Merge pull request #7 from hishamco/dev

Adds CookiePath to SessionDefaults
This commit is contained in:
Eilon Lipton 2015-03-13 09:15:17 -07:00
commit c2cbd62eec
3 changed files with 3 additions and 2 deletions

View File

@ -8,5 +8,6 @@ namespace Microsoft.AspNet.Session
public static class SessionDefaults
{
public static string CookieName = ".AspNet.Session";
public static string CookiePath = "/";
}
}

View File

@ -126,7 +126,7 @@ namespace Microsoft.AspNet.Session
{
Domain = _options.CookieDomain,
HttpOnly = _options.CookieHttpOnly,
Path = _options.CookiePath ?? "/",
Path = _options.CookiePath ?? SessionDefaults.CookiePath,
};
_context.Response.Cookies.Append(_options.CookieName, _sessionKey, cookieOptions);

View File

@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Session
/// <summary>
/// Determines the path used to create the cookie. The default value is "/" for highest browser compatibility.
/// </summary>
public string CookiePath { get; set; } = "/";
public string CookiePath { get; set; } = SessionDefaults.CookiePath;
/// <summary>
/// Determines if the browser should allow the cookie to be accessed by client-side JavaScript. The