Is there a way to save a variable after you redirect to another page. For example... I want to save the password submitted from my form into the variable $temp_passkey, and be able to access it on the next page that I redirected too.
I tried passing the argument through the url, but I don't want data to be visible in the url, so I need another way, or a way to hide the add_query_arg data from the url after the redirect.
function process_my_form() {
if ( ! empty($_POST['password']) ) {
$temp_passkey = ($_POST['password']);
}
wp_safe_redirect( esc_url_raw( add_query_arg( 'bid_passkey', $temp_passkey, '/secure-window' ) ) );
exit;
}
add_action( 'admin_post_process_my_form', 'process_my_form' );
add_action( 'admin_post_nopriv_process_my_form', 'process_my_form' );
/secure-window
and get the key from$_POST
? Not sure why a redirect is necessary here. – Jacob Peattie Feb 26 '19 at 10:09