We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 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

Stefan



10

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