josephwoodward / GlobalExceptionHandlerDotNet

Exception handling as a convention in the ASP.NET Core request pipeline
MIT License
269 stars 32 forks source link

Logging Session Id #29

Closed dharanish closed 5 years ago

dharanish commented 5 years ago

In the request pipeline if I use app.UseSession() after app.UseGlobalExceptionHandler(...), the httpcontext session object will not be available.

Is there any workaround for it?

josephwoodward commented 5 years ago

Oh really? I don't have much experience with the session middleware, but happy to take a look. Does it work if you add app.UseSession() before the Global Exception Handling middleware?

josephwoodward commented 5 years ago

Didn't mean the close the issue, I pressed the wrong comment button 😖

dharanish commented 5 years ago

If we add app.UseSession() before exception handler we can session object

josephwoodward commented 5 years ago

I presume this issue can be closed now? I'll close it, but if you're still having issues please feel free to reopen it.