fix users autologin on register problem and redirect loop if hosted on dyndns