How can I notify the user of a session end in asp.net?

I intend to notify the user 60 seconds before the session expires in asp.net. I would like the user to decide to resume the session or ignore the notification.

How can I achieve this in asp.net?

+3
source share
3 answers

When the page loads, you can set the javascript timeout for the popup at the appropriate time. This is not ideal, but probably good enough.

setTimeout("sessionAlmostGone()", 10 * 5 * 1000);
+2
source

HTTP does not provide a push client method; only pull is allowed. Your task looks like a “push” notification to a client.

Instead, use a client-side JScript timer that, after a timeout, displays a session resumption message. If so, AJAX allows you to notify the server of a session extension or closure.

+1
source

Source: https://habr.com/ru/post/1716188/


All Articles