Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
only emit session id cookie if check session endpoint is enabled (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen committed Dec 21, 2017
1 parent ade653f commit fc1084a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/IdentityServer4/Services/DefaultUserSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,15 @@ private string GetSessionIdCookieValue()

private void IssueSessionIdCookie(string sid)
{
if (GetSessionIdCookieValue() != sid)
if (Options.Endpoints.EnableCheckSessionEndpoint)
{
HttpContext.Response.Cookies.Append(
Options.Authentication.CheckSessionCookieName,
sid,
CreateSessionIdCookieOptions());
if (GetSessionIdCookieValue() != sid)
{
HttpContext.Response.Cookies.Append(
Options.Authentication.CheckSessionCookieName,
sid,
CreateSessionIdCookieOptions());
}
}
}

Expand Down

0 comments on commit fc1084a

Please sign in to comment.