working login session/error document redirection
actually working authentication