Welcome Guest, Not a member yet? Register   Sign In
Global session check and re-direct
#3

(04-04-2024, 01:49 AM)joho Wrote: To avoid having to put a session check in every single Controller function or "route", is it a good idea to put a "global check" in app/Config/Routes.php before anything else, and simply issue a re-direct (and die) before any routes are configured?

It is bad practice in the old Ci3 age.
It breaks the framework process flow.

Also, if you put die() in your code, you cannot write test code.
Because when you run test, the test runner will die with it.
Reply


Messages In This Thread
Global session check and re-direct - by joho - 04-04-2024, 01:49 AM
RE: Global session check and re-direct - by kenjis - 04-04-2024, 05:07 AM
RE: Global session check and re-direct - by joho - 04-04-2024, 06:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB