Starts in:
1 DAY
12 HRS
53 MIN
19 SEC
Starts in:
1 D
12 H
53 M
19 S
Open Closed

Changing Session Cookie Expiration #5400


User avatar
0
balessi75 created

ABP Commercial 7.2.1 / Blazor Server / EF / Non tiered / Separate Host and Tenant DBs / Lepton Theme

Hi, We are trying to change the user's session cookie expiration from "session" to a limited time frame.

We added the following in our BlazorModule.cs implementation of the ConfigureServices() method, but the cookie always still has an expiration of "Session" when we view the cookie in the browser tools. What might we be missing?

Thanks in advance...

     context.Services.ConfigureApplicationCookie(ops =>
        {
            ops.Cookie.Name = "AspNetCore.Identity.Application";
            ops.ExpireTimeSpan = TimeSpan.FromMinutes(1);
            ops.SlidingExpiration = true;
        });

4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I guess this will work when you click the Remember me

  • User Avatar
    0
    balessi75 created

    Hi mailiming,

    When Remember me is clicked the cookie expiration does take effect. This seems somewhat counterintuitive. Isn't the Remember me setting defined in a separate cookie?

    Any guidance or information is appreciated.

    Thanks

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    This is asp net core identity's design.

  • User Avatar
    0
    balessi75 created

    Thanks, looks like you are correct. Thanks for confirming.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06