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
Post a Comment