What is the difference between session_unset and session_destroy in PHP?
session_unset() is used to unset all variables in a session, while session_destroy() is used to destroy the session data. session_unset() does not destroy the session itself, it only clears the session data. On the other hand, session_destroy() completely destroys the session, including the session ID.
// Unset all session variables
session_unset();
// Destroy the session
session_destroy();