Open Closed

Idle Tracker feature #9376


User avatar
0
FelixKirschner created

Hello, I want to try out the new feature Idle Session Timeout. It is activated in the UI, I can see the JS loaded in the browser and I can see it also in the setting management tables. I can see in the application logs every few minutes query to ask the idle times. We are also using app.MapAbpStaticAssets(); Do you got any idea what the problem could be because the popup is not showing up and I am not logged out.

UI:

Browser:

Settings


6 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, the Idle Session feature checks inactivity on the JS side. So, if you scroll down on the page, click a section, or perform any other event, it can reset the idleTracker. So, are you sure that there is no inactivity on your side and that it's not triggering the dialog to confirm to sign in/sign out?

    Regards.

  • User Avatar
    0
    FelixKirschner created

    Yes I am 100% not triggering something on the side with my mouse. Some background jobs are running but I don't think they matter to JS. The idle timer settings are working completly on his own or? Because we got settings defintions too. Is there somewhere a demo side with working idle online?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [FelixKirschner] said: Yes I am 100% not triggering something on the side with my mouse. Some background jobs are running but I don't think they matter to JS. The idle timer settings are working completly on his own or? Because we got settings defintions too. Is there somewhere a demo side with working idle online?

    Okay, thanks for the confirmation.

    There is a component named AccountIdleViewComponent, which is added a layout hook for this feature:

            Configure<AbpLayoutHookOptions>(hookOptions =>
            {
                hookOptions.Add(
                    LayoutHooks.Body.Last,
                    typeof(AccountIdleViewComponent)
                );
            });
    

    This is the component that shows the idle timeout dialog, and also inserts 2 scripts to check inactivity on the JS Side (/Pages/Account/Idle/IdleTracker.js and /Pages/Account/Idle/Default.js).

    You can check your page source, and check if these two scripts are added or not. And also, ensure that you are not using persistent logins, because it's disabled for persistent logins:

  • User Avatar
    0
    FelixKirschner created

    The scripts which are added are the following:

    <script src="/_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/authentication-state-listener.js"> </script><script src="/_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/IdleTracker.js"></script> <script src="/_content/Volo.Saas.Host.Blazor/libs/chart/chart.min.js"></script> <script src="/_content/Volo.Abp.AuditLogging.Blazor/libs/chart/chart.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/libs/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/libs/jquery/jquery.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/js/lepton-x.bundle.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Server.LeptonXTheme/scripts/leptonx-blazor-compatibility.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/scripts/global.js"></Scrip> <script src="_framework/blazor.web.js"></script> <script src="/_framework/aspnetcore-browser-refresh.js"></script></body></html><

    So there might be the /Idle/Default.js missing.

    What is the easiest way to check if persistent login is enabled?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [FelixKirschner] said: The scripts which are added are the following:

    <script src="/_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/authentication-state-listener.js"> </script><script src="/_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/IdleTracker.js"></script> <script src="/_content/Volo.Saas.Host.Blazor/libs/chart/chart.min.js"></script> <script src="/_content/Volo.Abp.AuditLogging.Blazor/libs/chart/chart.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/libs/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/libs/jquery/jquery.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/js/lepton-x.bundle.min.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Server.LeptonXTheme/scripts/leptonx-blazor-compatibility.js"></script> <script src="/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/scripts/global.js"></Scrip> <script src="_framework/blazor.web.js"></script> <script src="/_framework/aspnetcore-browser-refresh.js"></script></body></html>< >
    So there might be the /Idle/Default.js missing.

    What is the easiest way to check if persistent login is enabled?

    Sorry, since you did not share the UI, I assumed that you are using MVC, this is the reason why I shared the scripts with you. For the blazor side, having /_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/IdleTracker.js is enough.

    And for the layout hook side, we register the AccountIdleComponent as follows, and it's already done on your side as well:

            Configure<AbpLayoutHookOptions>(options =>
            {
                options.Add(LayoutHooks.Body.Last, typeof(AccountIdleComponent));
            });
    

    In your setup, it seems it's already added to the layout, and the component is also added.So, it seems everything is correct on your side.

    I've tried the "Idle Session" feature on Blazor Server just before, but it did not work as you said. I'll create an issue for that.

    Regards.

  • User Avatar
    0
    FelixKirschner created

    Feature did work but some documentation was missing. GitHub Issue: https://github.com/abpframework/abp/issues/22970

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 v9.3.0-preview. Updated on June 13, 2025, 11:37