Roles fixes

Fixes sessions when logged in users are deleted and redirects to login when a http 401 is received.