I am writing a social networking site, and I am trying to figure out PHP sessions. At the top of the login page, I call session_destroy(), and I call session_start() at the
Use session_destroy to destroy the session data and session_unset to clear the $_SESSION
variable respectively.
Furthermore, call session_regenerate_id(true)
after an authentication attempt to change the current session’s ID and destroy the session data that is still associated to the old session ID.