Logout working safely (added session clearing)