I’m building a system in the PHP Codeigniter framework. I’m now building the authentication part and use as much examples as possible to do it the ‘right’ MVC way according to Codeigniters standards.
Tank_Auth is a popular plugin to use as authentication, but it uses loads of php redirects. According to me this is not the right way to handle for example a login. To me a login goes in this flow:
submit to index.php -> load login action using post -> load view
but tank_auth uses this like following:
submit to login.php -> redirect to index.php -> load view
does it matter which one is the best? I mean, to me it seems logical to prevent redirects.
Well how would Tank_auth know what data to send, what controller to use, etc after the login was successful? It would be a lot of useless coding to program in all the
$_POSTs and such.There is nothing wrong with the
redirect()function in Tank_auth, especially because Tank_auth has proven to be a very secure and robust authentication mechanism.Stop worrying!