Saving state in DataTables is done by storing the JSON string in a cookie, allowing it to maintain as much compatibility with the browser as possible while maintaining the state store on the client side. From time to time, it may be useful to change the settings stored in the table.
If you want to clear the state of the data when you log in, I would suggest simply clearing the storage.
The removeItem() method of the storage interface, when passing the key name, will remove this key from the storage.
function populateStorage() { localStorage.setItem('bgcolor', 'red'); localStorage.setItem('font', 'Helvetica'); localStorage.setItem('image', 'myCat.png'); localStorage.removeItem('image'); }
OR
Just write in javascript with loggin-out action.
echo '<script type="text/javascript">localStorage.clear();</script>';
t
<script type="text/javascript">localStorage.clear();</script>
source share