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;
        });
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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

    hi

    I guess this will work when you click the Remember me

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    This is asp net core identity's design.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    balessi75 created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.