I am doing a cakephp project. I was stuck here. I want to get the previous url in cakephp 3.2,but its not working. Here the link is present in email ,after clicking upon that link i will redirect to login page and after login ,i wnato to redirect to that previous url means the url present in mail only. I have written the below code to do it.
$rU = $this->request->referer();
if (!stristr($rU, "users/login") && !stristr($rU, "login") && !stristr($rU, "users/register") && !stristr($rU, "register") && !stristr($rU, "appadmins") && !stristr($rU, "js") && !stristr($rU, "css") && !stristr($rU, "ajax")) {
$this->request->session()->write('visited_page',$rU);
}
Plesae suggst me. Any suggestion will highly appreciate. Thank you.