Javascript tracking on shared devices - not working

Your software
My Mautic version is: 6.0
My PHP version is: 8.3.6
My Database type and version is: mysql

Your problem
My problem is: when using javascript on a shared device, when the user logs off, I setting the value for mautic tracking via javascript code below

    // Delete the mtc_id cookie on page load
    deleteCookie('mautic_device_id');
    deleteCookie('mtc_id');
    deleteCookie('mtc_sid');
    StorageSave('mautic_device_id', '');
    StorageSave('mtc_id');
    StorageSave('mtc_sid');

These errors are showing in the log:

When i log in with a second user, the page views still show up under user 1 vs user 2

Steps I have tried to fix the problem:

Verified that the cookies and local storage values are either removed or set to undefined.