clockwork icon indicating copy to clipboard operation
clockwork copied to clipboard

x-clockwork cookie lingers with incorrect values after disabling toolbar and client metrics

Open ssnepenthe opened this issue 2 years ago • 1 comments

Tested with laravel.

Steps to reproduce:

  1. Make sure clockwork-browser scripts are loaded and the toolbar is enabled - refresh the site so cookie is sent
  2. Disable both toolbar and client metrics collection and refresh the site site again
  3. The x-clockwork cookie is still present with toolbar set to true, so the toolbar will be visible even though disabled

Not sure what would be the preferred approach here:

  1. Ignore it - cookie has a 60 second expiration so the toolbar should disappear shortly.
  2. Drop the conditional here so that cookie is updated on every request. This would ensure that the toolbar and metrics portion of the cookie are updated to false
  3. Unset the x-clockwork cookie if present but toolbar and client metrics are currently disabled

ssnepenthe avatar Oct 26 '23 00:10 ssnepenthe

Hey, sorry, I somehow completely missed this issue. I guess we should be able to tell if the cookie is still present when the toolbar is disabled and remove it just in that case. That would be the cleanest solution. I'll take a look at this soon.

itsgoingd avatar Feb 20 '24 22:02 itsgoingd