How to keep my session alive until and unless user click on logout button using java script or any other best solution plz suggest ?
Loading
How to keep my session alive until and unless user click on logout button using java script or any other best solution plz suggest ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sibeesh VenuPosted Dec 26, 2014, 7:05 AM
function keep_alive()
{
http_request = new XMLHttpRequest();
http_request.open('GET', "/restricted_file_url");
http_request.send(null);
};
setInterval(keep_alive,840000);
You can find out more here :
http://www.div-tags.com/javascript/keep-session-alive-ajax-ping/
http://www.campusmvp.net/blog/how-to-avoid-expiring-session
Please accept and up vote if it helped you