We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Micro application. Redirect is not working.

https://gist.github.com/mrspartak/790eddb6619aff75634b

So this code is not redirecting when I access to / path. Is there any thoughts about why?



58.4k
Accepted
answer
edited Mar '14

@Assorium try, micro Always return if response

$app->before(function() use ($app) {
if($app->session->has("logged_in") !== true) {
return $app->response->redirect("/login");
//return false;
}