<script> document.cookie = "myJavascriptVar = " + myJavascriptVar </script> <?php $myPhpVar= $_COOKIE['myJavascriptVar']; ?>