Difference between session.setCookieAndRedirect() and signInWithRedirect()

Thank you @andrea for your reply.
I think that I will use setCookieAndRedirect since it doesn’t store accessToken and idToken in the local storage of the browser.

Howver, I’m wondering how to keep the session connected even if the client closes the browser?
I’m using the okta auth sdk, does it return a refresh token after an authentication success ?

Regards,
Hakim