Fix default cookie path computation, backport #1301