09f26ed9a7dcc52b03b4d3e5b2f97c5177cd9334
max
  Mon Sep 21 06:00:40 2026 -0700
Drop the ${hgsid} trackDb variable; add session ids to links in the browser instead

A description page's links can carry the session id without the page itself holding
one.  addHgsidToLinks() in utils.js walks the rendered page and appends hgsid to every
<a href> that stays on this host and points into the same cgi-bin directory: a relative
CGI link gets one, a static .html, a link to another host, a mailto and a plain #anchor
do not, and a link that already names a session is left alone.  hgc and hgTrackUi call
it through a new jsAddHgsidToLinks(), and hgTracks.js calls it on the track description
popup once the ajax content is in.  A link written with a literal $hgsid is rewritten
rather than skipped, so the description pages already deployed in the GenArk hubs work
again.

hVarSubst no longer knows about hgsid: it is out of the trackDb variable list, so
hVarSubstTrackDbHtml is a hub-only pass again and needs no cart, and hVarSubstWithCart
and webIncludeHelpFileSubst, which existed only to resolve it, are gone.  The variable
is taken out of the trackDb README and out of the twenty-odd description pages that
used it.

refs #38380

diff --git src/hg/lib/tests/expected/hVarSubstHtmlTest src/hg/lib/tests/expected/hVarSubstHtmlTest
index fe8b033df44..8bea446bc43 100644
--- src/hg/lib/tests/expected/hVarSubstHtmlTest
+++ src/hg/lib/tests/expected/hVarSubstHtmlTest
@@ -1,24 +1,19 @@
 a hub's description page
   $db resolves                   <p>assembly $db</p>                -> <p>assembly hg38</p>
   ${db} in braces too            <p>assembly ${db}</p>              -> <p>assembly hg38</p>
   $$db stays a dollar            <p>$$db</p>                        -> <p>$db</p>
   $hgsid is NOT a variable       <img src="http://x/p?s=$hgsid">    -> <img src="http://x/p?s=$hgsid">
   ${hgsid} is NOT a variable     <img src="http://x/p?s=${hgsid}">  -> <img src="http://x/p?s=${hgsid}">
   a price is not a variable      <p>costs $5 million</p>            -> <p>costs $5 million</p>
 
 a native description page
-  ${hgsid} is acted on           <a href="x?hgsid=${hgsid}">go</a>  -> <a href="x?hgsid=12345_abcdef">go</a>
-  $hgsid is left alone           <a href="x?hgsid=$hgsid">go</a>    -> <a href="x?hgsid=$hgsid">go</a>
+  ${hgsid} is not a variable     <a href="x?hgsid=${hgsid}">go</a>  -> <a href="x?hgsid=${hgsid}">go</a>
+  $hgsid is not a variable       <a href="x?hgsid=$hgsid">go</a>    -> <a href="x?hgsid=$hgsid">go</a>
   $db was done by hgTrackDb      <p>assembly $db</p>                -> <p>assembly $db</p>
   a price is not a variable      <p>costs $5 million</p>            -> <p>costs $5 million</p>
 
-with no cart at all
-  hub page, ${hgsid}             <img src="http://x/p?s=${hgsid}">  -> <img src="http://x/p?s=${hgsid}">
-  native page, ${hgsid}          <a href="x?hgsid=${hgsid}">go</a>  -> <a href="x?hgsid=${hgsid}">go</a>
-  hub page, $db                  <p>assembly $db</p>                -> <p>assembly hg38</p>
-
 nothing to substitute
   no dollar at all               <p>plain</p>                       -> <p>plain</p>
   empty page                                                        -> 
   a NULL track                   returned, no crash