The woocs_cookie filter changes the name of the session cookie FOX sets when Storage is set to FOX Session. By default the name is built as wp_woocs_session_ plus the WordPress COOKIEHASH of the site.
The reason to rename it is caching. Many CDNs and page caches decide whether a response is personal by looking at the cookie names in it, and several of them treat anything starting with wp_ as a logged-in WordPress cookie and bypass the cache for that visitor. Renaming the cookie to something outside that pattern lets the cache keep working.
add_filter('woocs_cookie', function ($name) {
return 'fox_currency_session';
});
Parameters:
$name (string) - the default cookie name
Returns:
- (string) the cookie name to use
Important: this filter has to be registered before the session object is built, which happens very early. Putting it in the theme's functions.php is too late — the code must live in a file inside wp-content/mu-plugins/.
Note: renaming the cookie does not help against caches that refuse to store any response carrying a Set-Cookie header at all, Cloudflare APO among them. For those, switch Storage to Transient and enable the cache option instead — from v.2.5.0 that combination keeps a key in the browser's localStorage and sets no cookie.