Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

browser close event and configurable session timeout #6256


User avatar
0
omkarchoudhari created
  1. How to get browser close event (window unload or onbeforeunload) ?
  2. can we have configurable session timeouts ?

I am using ASP.NET zero version v6.1.0 & Angular (Single Solution) + .NET CORE 2.1

Looking forward to an urgent reply please. Thanks.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @omkarchoudhari

    1. This is related to Angular rather than AspNet Zero. I think you can use somethin like this;

    `export class AppComponent { @HostListener('window:unload', [ '$event' ]) unloadHandler(event) { // ... }

    @HostListener('window:beforeunload', [ '$event' ]) beforeUnloadHander(event) { // ... } }`

    1. Angular app uses token based auth, not session. So, you can play with the lifetime of the token.
    2. You can do it in ConfigureTokenAuth method of AbpZeroTemplateWebCoreModule.cs