ScottHamper / Cookies

JavaScript Client-Side Cookie Manipulation Library
The Unlicense
1.77k stars 170 forks source link

cookies.js Cookie #78

Closed D-32 closed 4 years ago

D-32 commented 6 years ago

First of all: thanks for your work! I'm only using cookies for enabling development specific settings in my application. Otherwise, there no cookies that are used and we also tell our users that we don't store any cookies. Your library though adds a "cookies.js" cookie. This might look suspicious to users. I guess it's to detect if cookies are enabled or not. I don't need that feature. How can I disable that "cookies.js" being set?

ScottHamper commented 6 years ago

Hey Dylan,

That's an interesting use case! Currently, the API does not provide a facility for disabling the test cookie. If you've got a separate development environment from your production environment, my recommendation would be to only include the entire Cookies.js file when running in dev (via your build process or some other means).

This would likely be most ideal anyways, since there's no need for production clients to download the extra bytes for the library, regardless of whether the test cookie got set or not. It also would mitigate the risk of accidentally leaving in some dev code that uses the library in production, as that code would start throwing errors instead of inadvertently setting cookies.

Regards, --- Scott