Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

React to Http changes #38

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Microsoft.AspNet.Session/SessionMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,17 @@ public SessionEstablisher(HttpContext context, string sessionKey, SessionOptions
_context = context;
_sessionKey = sessionKey;
_options = options;
context.Response.OnResponseStarting(OnResponseStartingCallback, state: this);
context.Response.OnStarting(OnStartingCallback, state: this);
}

private static void OnResponseStartingCallback(object state)
private static Task OnStartingCallback(object state)
{
var establisher = (SessionEstablisher)state;
if (establisher._shouldEstablishSession)
{
establisher.SetCookie();
}
return Task.FromResult(0);
}

private void SetCookie()
Expand Down