How to keep my session alive until and unless user click on logout button using java script or any other best solution plz suggest ?
Keep session alive
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sibeesh VenuRank #27 · 42.9K reputationPosted Dec 26, 2014, 2:05 AM EST
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