I guess, this is happening only if user log in, and right after logging in he clicks to logout. Then when you press back button in the browser, there is sending form with $_POST data of his logging and the browser asks you if you want to send that form again. Am I right? Do you mean this?
If yes, then use this solution to avoid sending form again (when back button is clicked or F5 (refresh) is pressed):
When you process form with login data, do redirect to the same page, or to home page (its on you). Use
header("HTTP/1.1 302 Found");
header('Location: '.$url_to_redirect);
Then, when he clicks back button, or refresh page, it will not send again login data, so it will not log in him back.
If there is another reason, just comment, and I will explain more.