Skip to content

Commit b96630a

Browse files
Access SessionId at the beginning of Streamed https procs o to avoid HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
1 parent 14c0a52 commit b96630a

File tree

1 file changed

+6
-0
lines changed
  • dotnet/src/dotnetframework/GxClasses/Middleware

1 file changed

+6
-0
lines changed

dotnet/src/dotnetframework/GxClasses/Middleware/GXHttp.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,10 +1992,16 @@ private void SetStreaming()
19921992
#if !NETCORE
19931993
if (ChunkedStreaming())
19941994
{
1995+
BringSessionStateToLife();
19951996
context.HttpContext.Response.BufferOutput = false;
19961997
}
19971998
#endif
19981999
}
2000+
private void BringSessionStateToLife()
2001+
{
2002+
string sessionId = context.HttpContext.Session.SessionID;
2003+
GXLogging.Debug(log, "Session is alive: " + sessionId);
2004+
}
19992005
internal string DumpHeaders(HttpContext httpContext)
20002006
{
20012007
StringBuilder str = new StringBuilder();

0 commit comments

Comments
 (0)