Defina o PHP Variabe com JavaScript LocA Storage

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