I'm trying to get the previous URL in my login page using $_SERVER['HTTP_REFERER'], it shows undefined index.
I need to get the referrer URL in domain.com/login, it will redirected from domain.com/subfolder/logout. the logout page redirect to my login page, but I couldn't get the referer URL as the logout URL.
I tried window.history.go(-2);
and window.history.go(-1)
; , it only redirects to empty page not print any value.