Rehashed auth to work with cookies, in order to get IOS to work!