I am trying to avoid session expiration if user does not refresh the page more than 24 minutes e.g. is writing an article. I am sending an ajax request every 19 minutes.
setInterval( function()
{
$.ajax({
type: 'POST',
url: {link :Helper:default},
accepts : 'json',
complete: function( jqXHR )
{
if( jqXHR.status == 200 )
{
console.log( jqXHR.responseJSON.message );
}
else
{
alert( 'After few minutes you will be logged out due the browser inactivity.' );
}
}
});
}, 1000 * 60 * 19 );
But it does not work as I expect. If the interval is e.g. 5 minutes it works well, server returns json object with status 200 but it seems that session is not extended cause after 24 mins i am logged out however. Can you explain it to me please? I don't understand where is the problem.