Changed the way the session is unset. Using session_unset and session_destroy
all the session variables are destroyed. Instead of just the loggedin variable.