(04-20-2020, 02:42 AM)Leo Wrote: err, if anyone needs a quick fix for a redirect I just use this:
header('Location: /login');
exit();
it works everywhere so far, I actually have a check login function in my base controller where this is working from.
Beware though, it seems an exit() will prevent any of your "after stuff happens" events or filters from working.
Update: also a check login in base controller doesn't seem like a good idea anymore, so I made it as a public static function in a library
Thanks for the suggestion. The redirect worked fine using the header('Location...) way. However I still lost session data in the redirected location which was my problem. Have you tried it with session data?