I've learnt that
session_unset()
removes all session variables which means it just clears the $_SESSION
variable and it’s equivalent to doing:
$_SESSION = array();
This does only affect the local $_SESSION
variable instance/s.
session_destroy()
destroys the session data that is stored in the session storage.
My question are as below :
- Does session mean the $_SESSION super global variable?
- When session_destroy() will be called will the super global variable
$_SESSION
also get destroyed and becomes unaccessible? - If the super global variable $_SESSION doesn't become unaccessible even after calling
session_destroy()
then what it actually destroys when the session variable instances have already been destroyed bysession_unset()
?
Thanks.