 <p>You can call a PHP file from JavaScript and pass the variables you want via POST or GET. Or simply set a COOKIE.</p> <p>Cookie would be sent to PHP at the very first next page request and PHP can act on it.</p>