title: CakePHP redirect to previous URL after login
body: <p>I am using CakePHP 2.2.0, When a user is not logged in, when a link is clicked, it goes to the login page, after login i would like to redirect to the initial link that was clicked. Anybody knows how we can implement it using CakePHP? I tried with the <code>$this-&gt;referer()</code> but it seems not getting the previously visited URL. If anybody knows please help me to sort out!</p>