Im trying to create a new session beside wordpress session and set a property after wordpress login
function login_function() {
global $current_user;
$email = (string) $current_user->user_email;
$xxx = session_name("xxx");
session_set_cookie_params(0, '/', '.اینستا.com');
session_start();
$_SESSION['email'] = $email;
echo '<script language="javascript">';
echo 'alert('.$_SESSION['email'].')';
echo '</script>';
}
add_action('wp_login', 'login_function');
it shows empty and cant redirect successfully
UPDATE
echo 'alert('.$email.')';
happen the same thing, alert empty and fail to redirect successfully