if (req.restarts == 0 && fastly.ff.visits_this_service == 0) {

  # Allocate the user a unique identifier if they don't already have one
  if (req.http.Cookie:ab) {
    set req.http.Fastly-ABTest-UserID = req.http.Cookie:ab;
  } else {
    set req.http.Fastly-ABTest-UserID = uuid.version4();
    set req.http.abtest_new_cookie = "ab=" + req.http.Fastly-ABTest-UserID + "; max-age=31536000; domain=.fiddle.fastlydemo.net; path=/; secure; httponly";
  }

  set req.http.Fastly-ABTest-Queue = table.lookup(solution_abtest, "tests");

  call solution_abtest_allocate;
  call solution_abtest_allocate;
  call solution_abtest_allocate;
  call solution_abtest_allocate;
  call solution_abtest_allocate;
  call solution_abtest_allocate;
  call solution_abtest_allocate;
  call solution_abtest_allocate;
  call solution_abtest_allocate;
  call solution_abtest_allocate;

  unset req.http.Fastly-ABTest-Queue;
}