eaf4969a2f3cb75aca08d6fb418a590edb9dc761
max
  Wed May 7 02:04:44 2025 -0700
after comments from QA, making warning about request without cookie depend on hg.conf statement, no redmine, email from Lou

diff --git src/hg/lib/cart.c src/hg/lib/cart.c
index 4ef1caf8137..6f9b568e99f 100644
--- src/hg/lib/cart.c
+++ src/hg/lib/cart.c
@@ -1457,41 +1457,39 @@
 
 
 struct cart *cart;
 struct sqlConnection *conn = cartDefaultConnector();
 char *ex;
 boolean userIdFound = FALSE, sessionIdFound = FALSE;
 
 AllocVar(cart);
 cart->hash = newHash(12);
 cart->exclude = newHash(7);
 cart->userId = userId;
 cart->sessionId = sessionId;
 cart->userInfo = loadDb(conn, userDbTable(), userId, &userIdFound);
 cart->sessionInfo = loadDb(conn, sessionDbTable(), sessionId, &sessionIdFound);
 
-if (isEmpty(userId) && !cgiWasSpoofed())
-    fprintf(stderr, "CART userId not sent");
+if (sessionIdFound && !userIdFound && !cgiWasSpoofed() && cfgOptionBooleanDefault("noCookieTrace", FALSE))
+    fprintf(stderr, "HGSID_WITHOUT_COOKIE");
 
 if (sessionIdFound)
     cartParseOverHash(cart, cart->sessionInfo->contents);
 else if (userIdFound)
     cartParseOverHash(cart, cart->userInfo->contents);
 else
     {
-    if (isNotEmpty(userId))
-        fprintf(stderr, "CART userId sent but not in userDb");
     char *defaultCartContents = getDefaultCart(conn);
     cartParseOverHash(cart, defaultCartContents);
     }
 char when[1024];
 safef(when, sizeof(when), "open %s %s", userId, sessionId);
 cartTrace(cart, when, conn);
 
 loadCgiOverHash(cart, oldVars);
 
 fixUpDb(cart); // now is the time to see if someone is loading a Genark hub or specified a bad database.
 
 // I think this is the place to justify old and new values
 cartJustify(cart, oldVars);
 
 #ifndef GBROWSE