Answers for "do not remove session"

PHP
5

php delete session

session_destroy(); // To delete whole session
// OR
unset($_SESSION['myVar']); // To delete a session var
Posted by: Guest on January-24-2020
0

php session destroy not working

//make sure you don't forget to initialize session before destroying it
session_start() ;
session_destroy();
$_SESSION = [];//and clear it for this request
Posted by: Guest on August-06-2021

Browse Popular Code Answers by Language