Working early draft of authentication to return a cookie.