e6f37ac836c15aef886fd4d10af0ab23f17b4b86 chmalee Wed Aug 19 15:54:31 2020 -0700 Add a note about NOT adding CGI variables to the end of the URL in addSessionLink as it breaks short links when they are available diff --git src/hg/hgSession/hgSession.c src/hg/hgSession/hgSession.c index 1f11cc4..a814a0d 100644 --- src/hg/hgSession/hgSession.c +++ src/hg/hgSession/hgSession.c @@ -153,31 +153,33 @@ char *session = cartSidUrlString(cart); char returnAddress[512]; safef(returnAddress, sizeof(returnAddress), "%s?%s", hgSessionName(), session); printf("<A HREF=\"../cgi-bin/cartReset?%s&destination=%s\">Click here to " "reset</A> the browser user interface settings to their defaults.\n", session, cgiEncodeFull(returnAddress)); } void addSessionLink(struct dyString *dy, char *userName, char *sessionName, boolean encode, boolean tryShortLink) /* Add to dy an URL that tells hgSession to load a saved session. * If encode, cgiEncodeFull the URL. * If tryShortLink, print a shortened link that apache can redirect. * The link is an absolute link that includes the server name so people can - * copy-paste it into emails. */ + * copy-paste it into emails. + * + * NOTE: Do not append CGI variables here, as it will break short links if they are enabled. */ { struct dyString *dyTmp = dyStringNew(1024); if (tryShortLink && cfgOptionBooleanDefault("hgSession.shortLink", FALSE) && !stringIn("%2F", userName) && !stringIn("%2F", sessionName)) dyStringPrintf(dyTmp, "http%s://%s/s/%s/%s", cgiAppendSForHttps(), cgiServerNamePort(), userName, sessionName); else dyStringPrintf(dyTmp, "%shgTracks?hgS_doOtherUser=submit&" "hgS_otherUserName=%s&hgS_otherUserSessionName=%s", hLocalHostCgiBinUrl(), userName, sessionName); if (encode) { dyStringPrintf(dy, "%s", cgiEncodeFull(dyTmp->string)); } else