How can the issue of hiding the URL from users be addressed when using the POST method in PHP?

Issue: When using the POST method in PHP, the URL parameters are not visible to the users, but the form data can still be seen in the request body. To address this issue and hide the form data from users, you can use the session to store the form data and then redirect the user to a new page without displaying the form data in the URL.

<?php
session_start();

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $_SESSION['form_data'] = $_POST;
    header("Location: success.php");
    exit();
}
?>