Logout user and delete cookies from the client side?

You should be able to combine the solutions in these answers to achieve what you are looking for. Keep checking and if the internet connection drops, clear the cookies.

https://stackoverflow.com/questions/10426851/quickest-way-to-check-internet-connectivity-in-js
https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript