Not getting Meteor.userId() after page load

Meteor account disconnected while page refresh in accounts-ui package. I am checking Meteor.userId() on Flow routing.

appRoute.route(’/setting’, {
name: ‘setting’,
triggersEnter: [function(context, redirect) {
console.log(">>> “,Meteor.user()) //it returns undefined after page refresh
if(!Meteor.user()){
console.log(”===")
redirect(‘home’);
}
}],
action() {
mount(Home, {
main: ,
});
}
});

It takes a while to log in the user after a hard page load, you can check it with:

if (Meteor.loggingIn()) {
                this.render('loading');
            }
            else

Meteor.loggingIn() returns false and not working with it.

You mean Meteor.loggingIn() returns false and Meteor.user() is undefined at the same time?
If you, after that, type Meteor.user() in the console and get a user object, something is wrong…