Implemented logging in/out using ajax in order to avoid post redirections.