How to get session before routing

I check in my routing with
router.beforeEach((to, from, next) => {

}

if in router meta he need auth or not…
when Im log … this work realy good…
but if I refresh the page, I lost the connection…
I have a session-cookie and in my App.vue I check on created if the guys is connected
But the response I get isConnected = true is after the routing check the variable…

Do you have any exemple for help me?

Thanks a lot