dc98e9649a4105739f9b67322d61c520d3ab10c8
max
  Thu Aug 21 09:37:03 2025 -0700
making hgTables always set the cookie, which is important for the captcha, refs #36100

diff --git src/hg/inc/cart.h src/hg/inc/cart.h
index 5ba1df4aadf..7c41e124d2c 100644
--- src/hg/inc/cart.h
+++ src/hg/inc/cart.h
@@ -429,45 +429,44 @@
  * Exclude may be NULL.  If it exists it's a comma-separated list of
  * variables that you don't want to save in the cart between
  * invocations of the cgi-script. */
 
 void cartHtmlShell(char *title, void (*doMiddle)(struct cart *cart),
 	char *cookieName, char **exclude, struct hash *oldVars);
 /* Load cart from cookie and session cgi variable.  Write web-page preamble, call doMiddle
  * with cart, and write end of web-page.   Exclude may be NULL.  If it exists it's a
  * comma-separated list of variables that you don't want to save in the cart between
  * invocations of the cgi-script. oldVars is an optional hash that will get values
  * of things in the cart that were overwritten by cgi-variables. */
 
 void cartWriteCookie(struct cart *cart, char *cookieName);
 /* Write out HTTP Set-Cookie statement for cart. */
 
-void cartWriteHeaderAndCont(struct cart* cart, char *cookieName);
-/* write http headers including cookie and content type line */
-
 struct cart *cartAndCookie(char *cookieName, char **exclude,
 	struct hash *oldVars);
 /* Load cart from cookie and session cgi variable.  Write cookie and
  * content-type part HTTP preamble to web page.  Don't write any HTML though. */
 
 struct cart *cartAndCookieNoContent(char *cookieName, char **exclude,
 	struct hash *oldVars);
 /* Load cart from cookie and session cgi variable. Don't write out
  * content type or any HTML. */
 
-void cartWriteHeaderAndCont(struct cart* cart, char *cookieName);
+void cartWriteHeaderAndCont(struct cart* cart, char *cookieName, char *contType);
 /* write http headers including cookie and content type line */
+/* contType defaults to text/html when NULL.  */
+/* cookieName defaults to hUserCookie() when NULL */
 
 struct cart *cartAndCookieWithHtml(char *cookieName, char **exclude,
 	struct hash *oldVars, boolean doContentType);
 /* Load cart from cookie and session cgi variable.  Write cookie
  * and optionally content-type part HTTP preamble to web page.  Don't
  * write any HTML though. */
 
 struct cart *cartForSession(char *cookieName, char **exclude,
 	struct hash *oldVars);
 /* This gets the cart without writing any HTTP lines at all to stdout. */
 
 void cartSetDbConnector(DbConnector connector);
 /* Set the connector that will be used by the cart to connect to the
  * database. Default connector is hConnectCart */
 
@@ -686,17 +685,18 @@
 /* Set the current version of the cart, which is stored in the variable "cartVersion" */
 
 void cartRewrite(struct cart *cart, unsigned trackDbCartVersion, unsigned cartVersion);
 /* Rewrite the cart to update it to expectations of trackDb. */
 
 void cartTurnOnSuper(struct cart *cart, char **trackNames, unsigned numTracks, char *superTrackName);
 /* Turn on a supertrack if any of the subtracks are not hidden.  ASSUMES ALL TRACKS ARE HIDDEN
  * by default.
  */
 
 void cartMatchValue(struct cart *cart, char *oldTrackName,  char *newTrackName);
 /* Make new track have the same visibility as an old track */
 
 char *cartNamedSessionDbTable();
 /* Get the name of the table that lists named sessions.  Don't free the result. */
+
 #endif /* CART_H */