Auth test fixes

Fix for infinite loop in cookie-less environments is ready for review