Windows
View all Worklets
WindowsWindows

Clear Cookies in IE and Chrome

Purge Chrome and Internet Explorer cookies, cache, and history from Windows endpoints on a schedule

Worklet Details

What the Windows browser data purger does

This Automox Worklet™ purges cookies, cache, browsing history, and temporary internet files from Google Chrome and Internet Explorer on Windows endpoints. The Worklet sweeps multiple per-user storage locations, including the Internet Explorer INetCache and History directories, the Chrome User Data\Default profile, the Temporary Internet Files folder, and the legacy Documents and Settings paths used by older Windows profiles.

You set two retention windows in the remediation script. $DaysToDeleteIE controls Internet Explorer artifacts (default 1 day) and $DaysToDeleteChrome controls Chrome artifacts (default 7 days). The Worklet inspects each file's CreationTime and removes only items older than the matching threshold, so recent sessions stay intact while accumulated clutter is cleared.

The evaluation script returns a non-compliant exit code on every run. That design forces the remediation to execute on every policy cycle, which keeps the retention window honored on a recurring schedule rather than running once and drifting back to a packed cache.

Why purge browser data on a recurring schedule

Cookies, cached pages, and stored session tokens accumulate quickly on any endpoint with daily browser use. The Chrome User Data directory routinely passes a gigabyte on workstations with months of uncleared sessions, which slows page loads and inflates backup footprints. Persistent cookies and Login Data entries also widen the attack surface: a stolen profile directory can hand an attacker active sessions for every site the user did not explicitly sign out of.

Privacy regimes like CCPA and GDPR add a paper-trail problem, because user data that lingers beyond a documented retention window is harder to defend in an audit. A per-user habit of clearing cookies is not a control the security team can rely on. Schedule this Worklet on the cadence your privacy policy defines so the Chrome Cookies SQLite store and the Internet Explorer INetCache are cleared across every workstation in scope. Browser hygiene becomes an enforced control, and the purge supports session-token cleanup requirements under SOC 2 CC6 and PCI-DSS 8.2.

How browser data purging works

  1. Evaluation phase: evaluation.ps1 calls exit 1 unconditionally. The Worklet treats every Windows endpoint as out of compliance on every cycle, which forces the remediation to run each time the policy is scheduled.

  2. Remediation phase: The script defines eight Internet Explorer paths: $temporaryIEDir (C:\Users\*\AppData\Local\Microsoft\Windows\Temporary Internet Files\*), $cachesDir, $cookiesDir, $locSetDir, $locSetIEDir, $locSetHisDir, $IEHisDir, and $INetCache (C:\Users\*\AppData\Local\Microsoft\Windows\INetCache). It runs Get-ChildItem -Recurse -Force across all eight locations, filters with Where-Object { $_.CreationTime -lt (Get-Date).AddDays(-$DaysToDeleteIE) }, and pipes the result to Remove-Item -Recurse -Force. The script then targets three Chrome paths: $crLauncherDir for Chromium, $chromeDir at C:\Users\*\AppData\Local\Google\Chrome\User Data\Default, and $chromeSetDir for the legacy Local Settings location. It iterates an $Items pattern list (Archived History, Cache, Cookies, History, Login Data, Top Sites, Visited Links, Web Data) and removes any matching file older than $DaysToDeleteChrome. -ErrorAction SilentlyContinue is set throughout so locked files in an open browser do not abort the run.

Browser purge requirements

  • Windows workstation or server with Google Chrome or Internet Explorer installed

  • PowerShell 2.0 or later (the Automox agent ships with a supported runtime)

  • Local administrator rights for the Automox agent so the script can read each user's AppData and Local Settings directories

  • Set $DaysToDeleteIE to the number of days of Internet Explorer data to keep (default 1)

  • Set $DaysToDeleteChrome to the number of days of Chrome data to keep (default 7)

  • Close Chrome before scheduled runs where possible; open browser instances hold locks on Cookies and Login Data, and locked files are skipped silently

  • For Microsoft Edge or other Chromium-based browsers, fork the remediation and point the Chrome paths at the matching user data directory; this Worklet ships targeting Chrome and Internet Explorer only

Expected endpoint state after the purge

After remediation, the Internet Explorer INetCache, History, and Temporary Internet Files directories contain only items younger than $DaysToDeleteIE. The Chrome User Data\Default directory keeps only Cookies, Cache, History, Login Data, Top Sites, Visited Links, and Web Data files younger than $DaysToDeleteChrome. Disk usage under each user's AppData\Local\Google\Chrome\User Data and AppData\Local\Microsoft\Windows\INetCache drops back to the steady-state size that matches your retention window.

Users may need to re-authenticate to sites whose session cookies aged past the threshold, and autofill suggestions for sites not visited inside the retention window will be gone. Confirm a successful run from the Automox Activity Log, where the policy reports exit code 0 and the Verbose output enumerates the files removed. For ad hoc cleanup, trigger the Worklet through FixNow on a target endpoint and watch the activity stream for the completion event. Tune $DaysToDeleteIE and $DaysToDeleteChrome based on user feedback, support ticket volume, and the retention requirements your privacy program documents.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklets deploy named-CVE mitigations within hours of disclosure, perform configuration, remediation, and install or remove applications and settings across Windows, macOS, and Linux.

do more with worklets