-1
I have the code below in the same file:
add_action( 'init', 'iniciaSessao', 1 );
function iniciaSessao() {
if(!session_id() ) {
session_start();
}
}
function info() {
$_SESSION['nome'] = 'meu nome';
}
info();
//session_regenerate_id(true);
wp_redirect($minhaUrl);
exit();
By going to the website homepage (where you are redirecting) and using print_r($_SESSION['nome']);
the information set does not appear.
NOTE: the following error message appears when uncommenting the session_regenerate
:
session_regenerate_id(): Cannot regenerate Session id - headers already sent