Fix problems when redirected from login on session expiration

Resources used to be erased on authentication redirect for POST action

Replaced troublesome HTTP_REFERER redirects, they can lead to infinite redirects on expired session re-login