set api_key cookie after login