Add autoload cookies for lazy loading

Please see this patch.