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
The best way is by following the manual. Here is sample code that erases any session variables, the session cookie and then the session file itself: