We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

redirect after login

Hello there

when i access the resource www.foobar.com/myapp/user/edit and im not already authenticated, my application redirects me to /myapp/login/start

so far so good ...

but after i logged in successfully, the Login Controller forwards me to /myapp/index/index, not to the originally requested resource /myapp/user/edit

does anyone know how to implement this ?

Best regards



You can save your previous path in cookie or in session or in url param (like, /?backurl=/myapp/user/edit).

Use $this->response->redirect('user/edit'); and make use of the session variables as well