I was implementing simple menu, that would allow user to change site language. The site uses standard symfony2 localized urls like http://www.example.com/en/contact. The problem was to return user to a page, where he previously was, but rendered in a selected language. I didn’t like to do any find/replace on REFERER.
Let me show you my solution. Continue reading “Symfony2: how to redirect user to a previous page correctly (without using HTTP_REFERER)”