django-session-security icon indicating copy to clipboard operation
django-session-security copied to clipboard

Option to end session on tab close

Open as3445 opened this issue 6 years ago • 2 comments
trafficstars

One of the requirements for a project that I am working on is that the session would expire on tab close. I can imagine other may want a similar feature. I propose that this app implement an endpoint that the client can call .onbeforeunload() and the server will invalidate the session.

as3445 avatar Feb 14 '19 19:02 as3445

Django has built-in support for this.

claytondaley avatar Feb 14 '19 19:02 claytondaley

That will not work if I just close my tab without closing the window.

I have been looking up how I might do this, and actually there's no easy way to differentiate navigation to a new page vs closing the tab. 🤔 So .onbeforeunload() is actually not viable

as3445 avatar Feb 14 '19 19:02 as3445