Click here to Skip to main content
15,504,830 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Quote:
Hi everyone! I have a question / problem. The question / problem when I want to close the session in my system, when closing it is not achieved since when going back in the browser it is still displayed, that is, it did not close the session properly and I do not know what to do


This is my code:

<?php
 
session_start();
session_destroy();
header("location:login.php");
?>


What I have tried:

I tried very tutorials in Youtube and in forums
Posted
Comments
Chris Copeland 24-Nov-21 11:17am    
That's not a lot to go on, what part of your code is still assuming that there's a session active?

That being said, if you take a look at the session_destroy() documentation I don't think calling session_destroy() is enough. The documentation says that it won't unset global variables, and they provide an example (see Example #1) for completely removing all session data.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900