Skip to content

Commit

Permalink
Merge pull request #7 from hishamco/dev
Browse files Browse the repository at this point in the history
Adds CookiePath to SessionDefaults
  • Loading branch information
Eilon committed Mar 13, 2015
2 parents 20bcd63 + 177d1ff commit c2cbd62
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Microsoft.AspNet.Session/SessionDefaults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ namespace Microsoft.AspNet.Session
public static class SessionDefaults
{
public static string CookieName = ".AspNet.Session";
public static string CookiePath = "/";
}
}
2 changes: 1 addition & 1 deletion src/Microsoft.AspNet.Session/SessionMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void SetCookie()
{
Domain = _options.CookieDomain,
HttpOnly = _options.CookieHttpOnly,
Path = _options.CookiePath ?? "/",
Path = _options.CookiePath ?? SessionDefaults.CookiePath,
};

_context.Response.Cookies.Append(_options.CookieName, _sessionKey, cookieOptions);
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.AspNet.Session/SessionOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SessionOptions
/// <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
Expand Down

0 comments on commit c2cbd62

Please sign in to comment.