Validate Session timeout in Jquery

Validate Session timeout in Jquery

Dear All,

I have implemented setTimeout method to validate user session and redirect to login page when it expired as below.

setTimeout(function () {
        var Confrimresult = confirm("Your Session is Expirted, Do you want to reload Page?");
        if (Confrimresult == true) {
            window.location.href = "myloginpage";
        }
    }, 20 * 60 * 1000);

this works fine, but in our page we have some jquey ui sortable,draggable, droppable are using, when user perform this action, the above method still saying that session is expired after time period mentioned, that means client side events are not taking care by this method.

so i want to know how to handle this scenario.

OR,

i can go If i get best way to check our current session is expired or not using jquery

Regards,
M.Seenuvasan