3 ms·
Couldn't this be fixed by instead of using ?next= in the query string storing a cookie. For example: if(!auth) { setCookie('next', '/url-here', 1h
by nodesocket 10y ago
Couldn't this be fixed by instead of using ?next= in the query string storing a cookie.
For example:
if(!auth) {
setCookie('next', '/url-here', 1h);
}
redirect(login);
Login page action:
if(cookieExists('next')) {
next = getCookie('next');
deleteCookie('next');
redirect(next);
} else {
redirect('dashboard');
}
- detaro 10y agoCould easily muddle state with multiple tabs though, query string is clearer.