1363
Views
4
Comments
End session when user closes the tab or browser without logging out
Question

Hi,

How to end the session if user closes the tab or browser without logging out. If the user opens the page on history in chrome, it should direct to login screen but in my case its going to screen where user have been before.

Regards,

Wasim khan S


2017-05-24 05-47-08
Sivaramakrishna Repalle

Hi,

we can find the tab/browser close event in javascript using "window.onbeforeunload" & "window.onunload" events. you just need to call the logout action from javascript by clicking on logout icon.

you can refer below link for more detials.

https://stackoverflow.com/questions/3888902/detect-browser-or-tab-closing

Thanks,

Siva


2021-09-30 11-57-27
ALMIR DE FIGUEIREDO

When we call those functions? OnInitialize? OnDestroy? 

2026-02-26 06-29-24
Rahul
 
MVP

Hi Wasim,

Go throught this link- 

https://www.outsystems.com/forums/discussion/29807/clear-session-variable-when-the-application-is-closed/

here is oml attached you can use inside your application.


Hope this will help you.

Thanks 

Rahul Shau

2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Rahul Sahu wrote:

Hi Wasim,

Go throught this link- 

https://www.outsystems.com/forums/discussion/29807/clear-session-variable-when-the-application-is-closed/

here is oml attached you can use inside your application.


Hope this will help you.

Thanks 

Rahul Shau

Hi,

I can't find solution on it. 

Regards, 

Wasim khan S


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.