Possible Duplicate:
How do I kill a PHP session?
When ending a session, session_destroy() is supposed to destroy the session and the session variables registered with the session. But I’ve seen lots of codes that unsets all the registered session variables before destroying the session. Please who knows, what is the best practice?
session_destroy erases all of the session data, so it won’t be available at the next request. It does not unset
$_SESSIONhowever, and if your application relies on specific values in the$_SESSIONarray, it may behave in a wrong way. But you don’t need to unset each session variable, you can end session in this way: