Detect when someone logs out


4 Kommentare

  • Creighton Long
    Zendesk team member

    Hi Allen!

    You should be able to achieve the effect by placing something like the following inside the $(document).ready( function() { block in your Help Center's JS tab:

    $("a[href\*='/access/logout']").on("click", function() {  
      //your code to set cookie flag to 'collapsed' state  

    This code will cause the 'Logout' link to run your click handler (to set the cookie info) before it runs the default handler that links to the logout page.

    Hope this helps!

  • Creighton Long
    Zendesk team member

    My apologies for mistyping your name, Alan! Hopefully the solution makes up for it :)

  • Alan Oehler

    No problem, Creighton, I bet you get that happening to you more often than I do :-)

    I was away for the weekend and a PTO day yesterday, but this morning I tried your suggestion and it works like a top. 

    Simple and elegant solution, in retrospect I might have been able to think of that myself if I'd poked at it a little harder.

    I had asked Zendesk Support the same question and they basically told me it couldn't be done. So I passed on your solution to them.

  • Nicole S.
    Zendesk Community Team

    This thread has been closed for comments due to inactivity. Please start a new post if you have a question you'd like to ask the Community.


Post ist für Kommentare geschlossen.

Powered by Zendesk