Установите PHP variabe с JavaScript Loca Storage

 $phpvariable = "<script>document.write(localStorage.getItem('local_variable'))</script>";
Precious Pygmy