How to create a php script which make function run in background? -


i want create function runs in background. example deleting session database (id,session_token, session_identifier, expired_time). once it's expire current page automatically redirect user login page (login.php).

update

the expired time stored in database.

you can using jquery ajax , setinterval function

 function check_login() {             $.ajax({                 type: 'get',                 url: "http://stackoverflow.com", /*where check user logged in or not means session expired or not*/                 beforesend: function(xhr) {                     xhr.setrequestheader('content-type', 'application/x-www-form-urlencoded');                 },                 success: function(response) {                     /*ajax call return "still login" (or other response) if login*/                     if (response == 'still login') {                         return true;                     } else if (response == 'not login') {                         window.location.replace("http://domain.com/login.php");                     }                 }             });         }          setinterval(check_login, 100); 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -