Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams I set a sessionStorage on index.php as User scrolls down the page I store page State to sessionStorage.. now refreshing the page auto scrolls back to where the user left off.. but the challenges am having is destroying the sessionStorage... Though doing sessionStorage.removeItem(key) on same page I set the session, it Clears it but I want to Clear this when the user logs out instead Augustine Gabriel May 3, 2021 at 19:05

User Session Stored at Server side but sessionStorage is at client side script. add at "you have successfully logged out" page

echo '<script> sessionStorage.removeItem("key")</script>'; 
                I think that it would be more accurate to say that the <script> tag should belong on the "you have successfully logged out" page.  Alternatively, your client-side app could destroy its own SessionStorage key before issuing the logout call to the server.
– Mike Robinson
                May 3, 2021 at 19:47
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.