router query - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: router query (/showthread.php?tid=84842) |
router query - badger - 11-15-2022 A single redirect is causing two redirects and I can't figure out why. The code is intended to catch any uri containing "logout" and send it to the auth controller which will do the logout process. Many thanks for any help/advice Bill in Routes I have only the following Code: if(in_array('logout',explode('/',uri_string()))) { In the Auth controller I have Code: function loginout($par=false){ in my log file i see Code: route begin -> `front/logout` so the redirect to home in the Auth controller is called only once but the router sees it twice. The apache log confirms this Code: POST /front/logout Stupid me. A moments reflection is worth a years experience. The second call to home was caused by the ajax call acting on the response. Sorry RE: router query - InsiteFX - 11-15-2022 Hey, that's how we learn. |