User438705957 posted
I had an anchor element styled as a button for the users to click on to log out.
I needed to kill a few things on the server, so the onclick event caused a function to be run on the front-end which generated an AJAX call to the server to kill off those things. I set href="" thinking it was not needed.
When Users clicked on the button, the page was reloading and showing the login screen again.
I had several attempts to fix it, steeping through a thousand debug sessions and just couldn't crack it.
Finally I got the idea to to remove href="" and heh presto, it fixed the issue.
On investigation, I found that setting href="" causes a page reload.
I'm posting this here in order to save other programmers the pain I went through in diagnosing the problem.