Open Closed

How to increase user session timeout? #5232


User avatar
0
duyan11110 created
  • ABP Framework version: v7.0.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:" I tried to increase user session timeout but not successfully. I searched and added this code to both AuthServerModule and WebModule but no luck, the session is still expired after ~ 60 minutes (I guess). Pls help:
context.Services.ConfigureApplicationCookie(options =>
        {
            options.ExpireTimeSpan = TimeSpan.FromDays(1);
        });
        context.Services.Configure<SecurityStampValidatorOptions>(options =>
        {
            options.ValidationInterval = TimeSpan.FromDays(1);
        });

13 Answer(s)
  • User Avatar
    0
    Long.Nguyen created

    Hi,

    Can you try this one please ?

    context.Services.Configure<SecurityStampValidatorOptions>(options => options.ValidationInterval = TimeSpan.FromHours(24));

    https://stackoverflow.com/questions/49702256/why-does-my-identityserver4-based-server-timeout-in-30-minutes-and-only-support]

  • User Avatar
    0
    duyan11110 created

    Hi,

    In which module should I try that code?

  • User Avatar
    0
    duyan11110 created
    context.Services.ConfigureApplicationCookie(options =>
            {
                options.ExpireTimeSpan = TimeSpan.FromDays(1);
            });
            context.Services.Configure<SecurityStampValidatorOptions>(options =>
            {
                options.ValidationInterval = TimeSpan.FromDays(1);
            });
    

    I tried to add above code to both AuthServerModule and WebModule but it doesn't fix the issue.

  • User Avatar
    0
    duyan11110 created

    context.Services.ConfigureApplicationCookie(options => { options.ExpireTimeSpan = TimeSpan.FromDays(1); }); context.Services.Configure<SecurityStampValidatorOptions>(options => { options.ValidationInterval = TimeSpan.FromDays(1); });

  • User Avatar
    0
    duyan11110 created

    CB button is very strange: I copy and paste, it auto remove <SecurityStampValidatorOptions> part

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello duyan11110

    Is it user logging out or unauthorized after 60 mins automatically?

  • User Avatar
    0
    duyan11110 created

    Hi,

    Unauthorized after 60 mins automatically.

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi,

    could you please share the screenshot for the OpenIddict settings for the web client which is under administration -> OpenIddict ->Applications

  • User Avatar
    0
    duyan11110 created

    Hi,

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi

    can you try after allowing "Allow Refresh Token Flow"?

  • User Avatar
    0
    duyan11110 created

    Hi,

    OK, let me try and monitor.

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi

    If my previous answer will not help you then please try this link https://github.com/abpframework/abp/blob/1863a619f172634b2eb4842f0c241c40a9642c91/docs/en/Modules/OpenIddict.md?plain=1#L425

  • User Avatar
    0
    duyan11110 created

    Hi

    If my previous answer will not help you then please try this link
    https://github.com/abpframework/abp/blob/1863a619f172634b2eb4842f0c241c40a9642c91/docs/en/Modules/OpenIddict.md?plain=1#L425

    Hi,

    This one is the solution for my issue. Thanks.

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