I know it is pretty late, but I am adding my answer to help others. If you use wp_signon()wp_signon()
function to login, and verify with is_user_logged_in()is_user_logged_in()
thereafter, you need to set the current user with wp_set_current_user()wp_set_current_user()
first because wp_signon()wp_signon()
does not handle setting the current user as described in the wpWP codex:
https://developer.wordpress.org/reference/functions/wp_signon/
This is one of the reasons why the function is_user_logged_in()is_user_logged_in()
says false when you thought you have logged in a user already.