Skip to content
Advertisement

PHP How to completely destroy a session after leave the page

I want to make a simple PHP page where you can only access if you log in first. My code is something like this:

JavaScript

So my goal is that, when the user click onto the “Go back on page” button, the session gets destroyed, and only start a new after logged in. But now, if the user click onto the “Go back on page” button, than click onto the “Go forward on page” button. it says, Document Exired. It’s cool, but if I refresh the page, I can access the page without login.

Advertisement

Answer

Here is a solution

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement