diff --git a/core/src/org/labkey/core/login/LoginController.java b/core/src/org/labkey/core/login/LoginController.java index 4114d563504..20b18988f0a 100644 --- a/core/src/org/labkey/core/login/LoginController.java +++ b/core/src/org/labkey/core/login/LoginController.java @@ -672,8 +672,8 @@ else if (form.getTermsOfUseType() == TermsOfUseType.SITE_WIDE) response.put("approvedTermsOfUse", true); } - // Use the full hostname in the URL if we have one, otherwise just go with a local URI - String redirectString = redirectUrl.getHost() != null && redirectUrl.getScheme() != null ? redirectUrl.getURIString() : redirectUrl.toString(); + // Use relative path. If the host in the URL changes then our session won't follow us, and we won't be logged in (that kinda defeats the purpose of this API) + String redirectString = redirectUrl.getLocalURIString(); if (null != user) {