diff --git a/src/extensions/cookie/bootstrap-table-cookie.js b/src/extensions/cookie/bootstrap-table-cookie.js
index <HASH>..<HASH> 100644
--- a/src/extensions/cookie/bootstrap-table-cookie.js
+++ b/src/extensions/cookie/bootstrap-table-cookie.js
@@ -373,16 +373,13 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
   _toggleColumn (...args) {
     super._toggleColumn(...args)
+    UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns()))
+  }
 
-    const visibleColumns = []
-
-    for (const column of this.columns) {
-      if (column.visible) {
-        visibleColumns.push(column.field)
-      }
-    }
+  _toggleAllColumns (...args) {
+    super._toggleAllColumns(...args)
 
-    UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(visibleColumns))
+    UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns()))
   }
 
   selectPage (page) {
Adding cookie support for toggle all columns options