ISession Extension methods

net 6 newbie 121 Reputation points
2022-06-27T10:18:27.713+00:00

For creating/adding sessions I am using

  1. app.UseSession(); // middleware
  2. registering services as
    builder.Services.AddSession(options =>
    {
    options.Cookie.Name = "Session";
    options.IdleTimeout = TimeSpan.FromSeconds(500);
    options.Cookie.HttpOnly = true;
    options.Cookie.IsEssential = true;
    options.Cookie.SameSite = SameSiteMode.Lax;
    });

It is working fine. But my question is

the extension methods SetString(),GetString() on ISession interface are not found in the app.UseSession() middleware.
Then how this extension methods are working.

I have searched the src files in the following link but could not find where the extension methods are declared.

https://github.com/dotnet/aspnetcore/tree/main/src/Middleware/Session

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,165 questions
{count} votes