defaults to first tab if no cookie is set