Allow using HTTP REFERER as a fallback return URL

Several use cases (such as personalized UX and connection widgets) would be greatly improved by this feature.

N.B.: Just like form_login behavior, the feature is turned off by default.