locked
In IdSrv what is sessionstate used for? RRS feed

  • Question

  • User1358036820 posted

    I have a test server and get the response as below after logging in.

    Properties

    .AuthScheme
    oidc
    .Token.access_token
    eyJhbGciOiJSUzI1NiIsImtpZCI6InJ0bzZ0YlpkWTlRZmZZaGl0NHdtV0EiLCJ0eXAiOiJhdCtqd3QifQ.eyJuYmYiOjE1Nzk3Mzg0MDAsImV4cCI6MTU3OTc0MjAwMCwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMSIsImF1ZCI6ImFwaSIsImNsaWVudF9pZCI6ImludGVyYWN0aXZlLnB1YmxpYyIsInN1YiI6IjExIiwiYXV0aF90aW1lIjoxNTc5NzM4Mzk5LCJpZHAiOiJsb2NhbCIsInNjb3BlIjpbIm9wZW5pZCIsInByb2ZpbGUiLCJhcGkiLCJvZmZsaW5lX2FjY2VzcyJdLCJhbXIiOlsicHdkIl19.OVMw9oreQuacBo4UWW9pyht39vWct9kxWZjV7obbCNvVV3Aa17UE6Pb5nk4Gs3Gf6vk6OKhKEHTppkrVXlPqe54rZ1wGW-00TJTX1F2dSpc-wyBjK_e__TzWBHDIu1FeKM3cGdAkRkjgDdyKElVXfJlpurWO1TusDvMVXc1D_kcariufSCGGY6vCcxEUczqgj9YLSWhxDSSyCQS3x8Vv33jsbCkrBc3YccLLjftiPUQJIlD_glerj5dalqAGMJZcebgNoiQC3G6pMIskUUdA743Y5j3HmM2uywXa3pBzbrKtAPNycpMDaLBmANSU6Zv7ziFfYFvccwtn-eEBIcNxkA
    .sessionState
    6Tkit5tGnNnDzzeURr9n91JDlKJwpp1_K82ZxZbZt3s.kO_nUqGzYAF5ILcEvZdeuQ
    OpenIdConnect.Code.RedirectUri
    http://localhost:5002/signin-oidc

    What is the SessionState property used for?  Is it anything at all to do with Asp.net Session?

    Thursday, January 23, 2020 12:33 AM

All replies

  • User281315223 posted

    If you have ASP.NET Session state enable, there's nothing that Identity Server on it's own (that I'm aware of) that is going to specifically do to remove it. So the session state you see is likely just from your application itself.

    Thursday, January 23, 2020 4:19 AM
  • User665608656 posted

    Hi ammd,

    Session state, in the context of .NET, is a method keep track of the a user session during a series of HTTP requests. Session state allows a developer to store data about a user as he/she navigates through ASP.NET web pages in a .NET web application.

    The concept of a session is generic and applies to most web servers. Session state however is a Microsoft-centric concept.

    When a user visits a site, it’s sessions starts and when the user become idle or leave the site, the session ends. 

    More details, you could refer to this link :

    Session State in ASP.Net

    What is the difference between session variable and session state?

    Best Regards,

    YongQing.

    Thursday, January 23, 2020 5:36 AM
  • User1358036820 posted

    Thanks for the replies I am fully aware of what session state is in general but as I mentioned it was coming back in the sample applications along with token and other details as per my sample above.  I was wondering what it meant in that context as there is no session enabled in the IdSrv project by default.  As its a part of the response from the following code I was just thinking where it might have come from.

    @using Microsoft.AspNetCore.Authentication

    <h2>Claims</h2>

    <dl>
    @foreach (var claim in User.Claims)
    {
    <dt>@claim.Type</dt>
    <dd>@claim.Value</dd>
    }
    </dl>

    <h2>Properties</h2>

    <dl>
    @foreach (var prop in (await Context.AuthenticateAsync()).Properties.Items)
    {
    <dt>@prop.Key</dt>
    <dd>@prop.Value</dd>
    }
    </dl>

    Thursday, January 23, 2020 12:17 PM