Capturing ASP.NET Session Timeout in GeneXus Application

I need to capture an ASP.NET Session Tiemout in a GeneXus X application generated in C #. When the user stays away from the keyboard for more than N minutes, I would like to request the user password / password again without losing data in webform

+3
source share
1 answer

You just need to increase the timeout for the session on the server so that you don’t need to solve the problem at all.

If this is not an option, you can make a user control that periodically checks if the session is active through ajax, for example, using JQuery (not verified):

$(function() {
    setInterval(CheckSession, 10000); /*10 seconds*/
});

function CheckSession() {
    $.get("/CheckSession.aspx", function(data) {
        $("body").append("<p>" + data + "<p/>"); /*shows current user*/
        if(data = "")
           $("#loginform").fadein(200);
    });
} 

CheckSession - /http-, -

&httprespone.addstring(&websession.get('userid'))

, , - :

, .

, javascript.

+3

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


All Articles