PHP - how to watch for cookie (every second or time interval)? -


i want watch cookie , if cookie exist somethink. tried :

while (true) {     sleep(1);     if ($_cookie['name'])     {         dosomethink();      } } 

but code make execution 'sleep'.

is there way watch without stopping execution?

if browser activity, better way may javascript setinverval() ajax call php function.

otherwise, i'd recommend running php script via cron. there's no other way know run php asynchronously, you're trying accomplish.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -