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
Related Posts:
- How to delete a cookie?
- javascript set cookie with expire time
- display variable image using cookies
- jQuery $.cookie is not a function
- How do I set/unset a cookie with jQuery?
- Make Axios send cookies in its requests automatically
- How do I create and read a value from cookie?
- Get cookie by name
- How do I check if a cookie exists?
- Rest API authentication issue when called from fetch request in bundle.js
- How to generate the COOKIEHASH from JavaScript
- Console Messages: A cookie associated with a cross-site resource at
- How are cookie values encoded?
- how to refresh page after user logout with ‘wp_logout_url’?
- How can I generate a rainbow circle using HTML5 canvas?
- Which equals operator (== vs ===) should be used in JavaScript comparisons?
- are there dictionaries in javascript like python?
- Jest spy on functionality
- Use a JSON array with objects with javascript
- Toggle show/hide on click with jQuery
- Client on Node.js: Uncaught ReferenceError: require is not defined
- jQuery .on(‘change’, function() {} not triggering for dynamically created inputs
- How to create a jQuery function (a new jQuery method or plugin)?
- How do you check if a variable is an array in JavaScript?
- Understanding React-Redux and mapStateToProps()
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- How to get the browser to navigate to URL in JavaScript
- In angularjs we are having ng-disabled directive, why ng-enabled directive is not provided by the framework as we are having ng-show and ng-hide
- Send POST data using XMLHttpRequest
- querySelector vs. getElementById
- Google weather widget on my website
- How to generate a simple popup using jQuery
- How to convert an Object {} to an Array [] of key-value pairs in JavaScript
- Javascript versioning to avoid caching, difference in these practices?
- SyntaxError: Unexpected token o in JSON at position 1
- Fastest way to duplicate an array in JavaScript – slice vs. ‘for’ loop
- When is JavaScript synchronous?
- How to reset a form using jQuery with .reset() method
- Uncaught ReferenceError: Firebase is not defined
- Efficient way to implement Priority Queue in Javascript?
- How do you format a Date/Time in TypeScript?
- JavaScript function in href vs. onclick
- How to scroll to an element?
- How would I call a javascript function in html?
- Count the number of occurrences of a character in a string in Javascript
- Javascript removeEventListener not working
- Load image with jQuery and append it to the DOM
- RGB to hex and hex to RGB
- No visible cause for “Unexpected token ILLEGAL”
- Change text on hover, then return to the previous text
- TypeError: res.json is not a function
- How to do case insensitive string comparison?
- Understanding the ngRepeat ‘track by’ expression
- How can I test if a letter in a string is uppercase or lowercase using JavaScript?
- How to create a HTML Cancel button that redirects to a URL
- What does the construct x = x || y mean?
- Discord error cannot read property ‘isFocused’
- onClick not working React js
- Jest encountered an unexpected token
- How to get the first element of an array?
- How to instantiate a File object in JavaScript?
- How to change the buttons text using javascript
- How to sort in mongoose?
- “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project
- Cannot read property ‘forEach’ of undefined
- JavaScript: function returning an object
- What is the non-jQuery equivalent of ‘$(document).ready()’?
- Changing the selected option of an HTML Select element
- How to export JavaScript array info to csv (on client side)?
- Should I use encodeURI or encodeURIComponent for encoding URLs?
- Is it Possible to Extend WP Customize JS Methods?
- What are all the query parameters for getEntityRecords?
- How to add code to just before closing body tag
- How to prevent text modified using gettext filter being stomped (presumably) by updateText() js function within a CPT’s edit screen
- Load multiple Javascript scripts
- WP script versioning breaks cross-site caching?
- Customizer JS API: Defining control settings
- Is there a client side API for handling transients or options?
- Using React.js in WordPress
- How should I add JavaScript to a child theme?
- How to add JavaScript file using wp_enqueue_scripts?
- How to Add Javascript Only When a Function Exists?
- TypeError: window.tinyMCE.execInstanceCommand is not a function
- How to load javascript file on homepage in WordPress in order?
- event/callback on block update?
- Insert “javascript:void(0);” into URL
- Call post-id from URL hash not working?
- wordpress 4.4 upgrade visual editor bullets select for not selected elements
- Script to Automatically Advance to the Next Page of a Paginated Post
- Gutenberg consume wp-json data and reflect in frontend the content
- How can I get user data into a javascript object?
- WordPress load-scripts.php not loading
- How to use WP switchEditors.switchto(this) JS function in your own script?
- Removing admin javascript
- Uncaught TypeError: r is not a function
- How to show cities according to the state in Form using Javascript? [closed]
- Can I get the user name in JavaScript?
- Landing function through URL
- Custom JS doesn’t work after 4.9.9 update [closed]
- Loading 2 Different Version of JS files [closed]