I am using session control in PHP, but am having difficulty closing a session properly.
If I include session_destroy(); within a PHP module, I cannot access $_SESSION variables within that module. If I omit session_destroy();, I leave the session open, with the security problems this implies.
How do I get over this?
Ending a session
Moderator: General Moderators
Re: Ending a session
You can use session_unregister(), if you want to destroy session of some specific variable, which will not destroy all your session variables. As you are using session_destroy(), it destroy all sessions.