I want to implement a logout function. When a user clicks Logout, I want to end their session and redirect to another page. Sadly, I am limited to only JavaScript.
EDIT:
Moving this over to Zendesk because it seems like they have a Remote Authentication API.
Thank you to all the people who answered.
It depends on what server technology you’re using.
Let’s say there’s a logout.aspx page. You could just do an AJAX request to that page to zap the session, or delete a cookie that the application might be using to cache authentication, then redirect like so:
window.location = "http://www.mysite.com/logout.aspx";UPDATE
I just found this post on SO that should help (that wasn’t easy):
https://stackoverflow.com/questions/3237476/zendesk-remote-auth-using-java