Properly handle redirections

Redirections from login view can make the Manager lose all the data (when clicking save with session expired and returning from login) and get stuck in redirect loop.
This patch fixes this behaviour.