What kind of authentication are you using? Basic Authentication does not support it by default so you need to setup some tricks. See this link for some tips: http://stackoverflow.com/questions/4154187/how-to-logout-user-for-basic-http-authentication I think the best solution would be an external monitor that you can script.
Another popular authentication method nowadays seem to be the JSON WEB TOKEN. See here some intro (the takeaway is that the app has a /logout page and they destroy the tokens). --> https://github.com/dwyl/learn-json-web-tokens. That should be easy you just have to chain the GETs with one to /logout.