Adding a custom logout button

Our team writes applications and application launchers that are based on Pipeline Pilot.  Users typically start with a site-specific URL to run a protocol via a Restful call either via launchjob explicitly or via a bookmarked version of the URL you get when you choose "Create Protocol Link" in the Pro Client.  We would ideally like to provide a customized logon and logout experience.  I asked separately about logon options, and so here I want to concentrate on logging out.

 

Because a user might be authenticated though PP in multiple browser tabs/windows I wanted to draft a Logout button that our developers could include for consistent experience which would first pop up a warning that explains this and then allows them to proceed.  To proceed I hoped to use the semi-documented session logout link \\\$(SSLSERVERROOT)/security/sessions/logout BUT this includes a default redirect to the server home page after the logout is enacted.  Is there a way to override this?  I have thus far been unsuccessful in my attempts using the green reporting components and even just experimenting with URLs in the browser.  I am guessing this is another case where I might need the JavaScript SDK (which no longer seems to have documentation exposed), but I am hoping that there is a simpler option.  I am fairly certain there is a ?redir= option for the /security/sessions/logout URL but it is not working in my hands if I simply give it a URL or a urlencoded URL.  Can you provide an example protocol that simply creates a LOGOUT button that redirects to a specified protocol URL on invocation?  That would ideally trigger an auth window to be popped up and get them where we want if they reauthenticate.