I was implementing a login system in symfony2 which includes security.xml configuration and some custom stuffs...
At successful login the symfony sends user to a specific controller where i wrote few codes to populate some additional data to session. It was working fine so far as we started application from login page so far.
But in some cases when we access some page which requires authentication, symfony force us to login page. after success login it takes us directly to that page (where we came from) instead landing page. In this cases the extra code we wrote on landing page is not getting executed, hence the app is not behaving as expected further.
My Question is to overcome this... is there any hook / setting / function present in symfony2 by which i can execute a set of code on all successful login irrespective of which page user is getting redirected.