Add autoload cookie for the hook function