Merge pull request #7 from hishamco/dev
Adds CookiePath to SessionDefaults
This commit is contained in:
commit
c2cbd62eec
|
|
@ -8,5 +8,6 @@ namespace Microsoft.AspNet.Session
|
||||||
public static class SessionDefaults
|
public static class SessionDefaults
|
||||||
{
|
{
|
||||||
public static string CookieName = ".AspNet.Session";
|
public static string CookieName = ".AspNet.Session";
|
||||||
|
public static string CookiePath = "/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +126,7 @@ namespace Microsoft.AspNet.Session
|
||||||
{
|
{
|
||||||
Domain = _options.CookieDomain,
|
Domain = _options.CookieDomain,
|
||||||
HttpOnly = _options.CookieHttpOnly,
|
HttpOnly = _options.CookieHttpOnly,
|
||||||
Path = _options.CookiePath ?? "/",
|
Path = _options.CookiePath ?? SessionDefaults.CookiePath,
|
||||||
};
|
};
|
||||||
|
|
||||||
_context.Response.Cookies.Append(_options.CookieName, _sessionKey, cookieOptions);
|
_context.Response.Cookies.Append(_options.CookieName, _sessionKey, cookieOptions);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Session
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines the path used to create the cookie. The default value is "/" for highest browser compatibility.
|
/// Determines the path used to create the cookie. The default value is "/" for highest browser compatibility.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CookiePath { get; set; } = "/";
|
public string CookiePath { get; set; } = SessionDefaults.CookiePath;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if the browser should allow the cookie to be accessed by client-side JavaScript. The
|
/// Determines if the browser should allow the cookie to be accessed by client-side JavaScript. The
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue