index.js file
sessionStorage.setItem('name', 'xxxx');
login.php
<?php echo $_SESSION['name'] ?>
in my index.html page i get the name and store it in session using javascript
after the page will navigate to login.php in that i cant able to get the session variable
pls do help me to solve the issue.
sessionStoragethan it doesnt mean that it is storing values to server's sessionsessionStorageand PHP$_SESSIONare completely unrelated. The first one lives in the browser (client-side) and the second on the server (server-side). They can't interact directly with each other whatsoever. w3schools.com/html/html5_webstorage.aspSessionStorageandLocalStorageallows to save key/value pairs in a web browser