05094dabf3d005ab35a998ff225443fc4255611f
galt
  Mon Feb 4 23:07:42 2019 -0800
Adding ability to backup and restore the cart and its custom tracks in hgSession.

diff --git src/hg/inc/cart.h src/hg/inc/cart.h
index a6aa87c..37e5f11 100644
--- src/hg/inc/cart.h
+++ src/hg/inc/cart.h
@@ -67,39 +67,47 @@
 
 struct cart *cartOfNothing();
 /* Create a new, empty, cart with no real connection to the database. */
 
 struct cart *cartFromHash(struct hash *hash);
 /* Create a cart from hash */
 
 struct cart *cartFromCgiOnly(char *userId, char *sessionId,
 	char **exclude, struct hash *oldVars);
 /* Create a new cart that contains only CGI variables, nothing from the
  * database, and no way to write back to database either. */
 
 void cartCheckout(struct cart **pCart);
 /* Save cart to database and free it up. */
 
+void cartSaveState(struct cart *cart);
+/* Free up cart and save it to database.
+ * Intended for updating cart before background CGI runs.
+ * Use cartCheckout() instead. */
+
 void cartEncodeState(struct cart *cart, struct dyString *dy);
 /* Add a CGI-encoded var=val&... string of all cart variables to dy. */
 
 char *cartSessionVarName();
 /* Return name of CGI session ID variable. */
 
 char *cartSessionId(struct cart *cart);
 /* Return session id. */
 
+unsigned cartSessionRawId(struct cart *cart);
+/* Return raw session id without security key. */
+
 char *cartSidUrlString(struct cart *cart);
 /* Return session id string as in hgsid=N . */
 
 char *cartUserId(struct cart *cart);
 /* Return session id. */
 
 void cartRemove(struct cart *cart, char *var);
 /* Remove variable from cart. */
 
 void cartRemoveExcept(struct cart *cart, char **except);
 /* Remove variables except those in null terminated except array
  * from cart.  Except array may be NULL in which case all
  * are removed. */
 
 struct slPair *cartVarsLike(struct cart *cart, char *wildCard);