JavaScript lives in the browser, PHP lives on the server.
To pass a value from JavaScript to a PHP page, you can either
do an HTML form submit
use AJAX
In both cases, the value is sent to...
Inside your Javascript (wherever is appropriate) //First get an expires date... var today = new Date(); //right now. var expires = new Date(); //These are the values the cookies gonna end up with var...