fixed bugs in client for auth cookie