autoLogin & cookies

I have a question about autoLogin webdriveIO and cookies. I use autoLogin to log into the webpage. The cookie after login have to be saved and later restored by autoLogin.
saveToFile: true,

restore: (I, cookie) => {
I.amOnPage('xxx');
I.setCookie(cookie);
},

The cookie is saved right after execution, when no cookie is available. So the cookie content is undefined. What I have to do to save the cookie to the cookie file?

Yes, faced with that too.
It is always undefined or it also can be empty…