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.
6 Answer(s)
-
0
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.
-
0
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?
-
0
[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:
-
0
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?
-
0
[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.
-
0
Feature did work but some documentation was missing. GitHub Issue: https://github.com/abpframework/abp/issues/22970