![]() |
[RedirectClass] toReferrer - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29) +--- Thread: [RedirectClass] toReferrer (/showthread.php?tid=91150) |
[RedirectClass] toReferrer - christianberkman - 06-24-2024 In my project is is likely users will open multiple tabs but continue navigating on the original tab. In this case, using redirect()->back() produces unexpected behavior. Example
Code: redirect()->back() However, would there be enough of a use case to add a Code: redirect()->toReferrer() function to cover the case I just described? Of course, this would be not much more than a convenience function as the functionality can already be achieved with other functions from the framework. I would be happy to open a PR. RE: [RedirectClass] toReferrer - kenjis - 06-24-2024 HTTP_REFERER is not reliable. So if you want to use it, redirect()->to($referer) by yourself. RE: [RedirectClass] toReferrer - kenjis - 06-24-2024 There is no need to use back() or referer in the first place. You can just specify the URI in the controller. |