use cookies for key retrieve