Using Sessions with ASP.NET Core

Asked 2 years ago, Updated 2 years ago, 182 views

Sessions and Application States in ASP.NET Core
https://docs.microsoft.com/ja-jp/aspnet/core/fundamentals/app-state?view=aspnetcore-2.2

Sample Source
https://github.com/aspnet/Docs/tree/master/aspnetcore/fundamentals/app-state/samples/2.x/SessionSample

The above tutorials and sample sources are referenced, but the session will not be activated.
·Session values are not maintained across requests
·Cookie does not have a session ID
The same is true if you run the sample source as it is.
Is there something missing?

asp.net cookie session asp.net-core

2022-09-30 19:47

1 Answers

I don't know why, but
You can now use the session by commenting out the following lines:

Startup.cs

options.CheckConsentNeeded=context=>true;


2022-09-30 19:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.