Storage

Delete Storage

Manage and clear browser storage data.

Manage and clear browser storage data.

Clears or selectively deletes browser storage based on the requested storage type (cookies, localStorage, sessionStorage, cache or indexedDb). If no storage type is provided, globally clears all browser storage. Otherwise provides targeted removal using domain, key, path, or storeName.

TIP

Deleting a specific 'storageType' without specifying any other parameters will delete all storage of that type. <table border="1" cellspacing="0" cellpadding="8"> <thead> <tr> <th>Storage Type</th> <th>Domain filtering / scoping</th> <th>Path filtering / scoping</th> <th>StoreName filtering / scoping</th> <th>Key filtering / scoping</th> <th>Wildcard allowed? (on which fields)</th> <th>Required for Set?</th> </tr> </thead> <tbody> <tr> <td>Cookies</td> <td><code>action.Domain</code></td> <td><code>action.Path</code> (cookie path)</td> <td>(unused)</td> <td><code>action.Key</code> (cookie name)</td> <td>Domain, Path, Key</td> <td>Key + Data; Domain/Path optional</td> </tr> <tr> <td>LocalStorage</td> <td>(implicit current origin)</td> <td>(unused)</td> <td>(unused)</td> <td><code>action.Key</code></td> <td>Key only</td> <td>Key + Data</td> </tr> <tr> <td>SessionStorage</td> <td>(implicit current origin)</td> <td>(unused)</td> <td>(unused)</td> <td><code>action.Key</code></td> <td>Key only</td> <td>Key + Data</td> </tr> <tr> <td>Cache Storage</td> <td>(implicit current origin)</td> <td>(unused)</td> <td><code>action.StoreName</code> (cache name)</td> <td><code>action.Key</code> (cache name / request)</td> <td>StoreName, Key</td> <td>StoreName, Key + Data</td> </tr> <tr> <td>IndexedDB</td> <td>(unused — IndexedDB is origin-scoped)</td> <td><code>action.Path</code> (database name)</td> <td><code>action.StoreName</code> (object store)</td> <td><code>action.Key</code> (record key)</td> <td>Path, StoreName, Key</td> <td>Path + StoreName + Key + Data (exact)</td> </tr> </tbody> </table>

Examples

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.DeleteStorage(WebsiteStorageType storage type, bool deleteAcrossOrigins, string domain, string path, string key, string storeName);

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.DeleteStorage(WebsiteStorageType.cookie).WithStorageDomain("ebay.com").WithStorageKey("utag_main_ses_id").Execute(); browser.PuppeteerClient.DeleteStorage(WebsiteStorageType.cookie).WithDeleteAcrossOrigins(true).Execute();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.DeleteStorage(string storageType, string sessionId, string domain, string storeName, string path, string key);

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.DeleteStorage).Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.DeleteStorage).WithStorageType(WebsiteStorageType.cookie).WithStorageDomain("ebay.com").WithStorageKey("utag_main_ses_id").Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.DeleteStorage).WithStorageType(WebsiteStorageType.cookie).WithStorageDomain("youtube.com").Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.DeleteStorage).WithStorageType(WebsiteStorageType.cookie).Execute();