• I have an add filter hook for wp_authenticate_user where I am setting a session var for later use in an API, if i check the var IN the function it displays as expected outside the function it is NULL

    function sbci_get_user_pass($val1, $val2){
    if(!session_id()) {
    session_start();
    }
    $_SESSION["val2"] = $val2;
    echo $_SESSION["val2"]; // displays actual value
    return $val1;
    }
    add_filter('wp_authenticate_user', 'sbci_get_user_pass',1,2);

    var_dump($_SESSION["val2"]); // displays NULL

    any suggestions or insight is appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.