Closed tremby closed 6 years ago
Experiencing the same issue on Safari 11/Mac and on Chrome 63/Mac
I just dug into it a bit.
I was setting the preview cookie without a domain parameter. The toolbar code never attempts to delete the cookie with no domain parameter. But to delete a cookie you need the domain parameter to match exactly.
So my workaround is to set the preview cookie with a domain -- now the toolbar will delete it. Specifically, I set domain to be the value of location.hostname
.
However, this should be fixed in prismic-toolbar; it should attempt the deletion without the domain parameter as well as with.
Thanks for sharing that @tremby, explicitly setting the domain worked for me too!
Ok got it. I'm going to fix this.
Ok it's fixed in the prismic.js script: static.cdn.prismic.io/prismic.min.js
.
Just to let you know that the prismic-toolbar
has been deprecated and won't get anymore updates.
The official way to go is to use static.cdn.prismic.io/prismic.min.js
.
Is the source available for the one on your CDN there?
As you can see from my pull requests here, there are various features I want. I'll contribute or fork. To have neither option would be quite a shame.
No worries, We're going to keep the work here. BTW, the PR that fixes the close session
is here https://github.com/prismicio/prismic-toolbar/pull/17.
So this is not deprecated after all? I'm confused.
The toolbar itself isn't deprecated. What is deprecated is the npm package. Sorry I wasn't very clear.
I'm still confused.
You said "We're going to keep the work here", and showed me the patch which fixes this issue, and it's here in this repository, which the NPM package is built from. But then you say the NPM package is deprecated. Are you saying that the source for the toolbar you publish on your CDN will stay up to date here in this repository, you're just not going to publish an NPM package of it any more?
Yes that's it. We're going to unpublish prismic-toolbar npm package.
I take it the reason is to encourage people to use the version on your CDN, so people aren't complaining about broken things you've already fixed, and possibly so you can get stats on usage.
Please forgive me repeating myself, but just so we're totally 100% clear, is this repository going to remain the source of the build you distribute on your CDN? (I.e. will this repository stay up to date?)
The answer is Yes. I confirm that repository will always be used for prismic.js script we distribute over our CDN.
The cookie is not being properly deleted when I click to close the toolbar. I'm getting this both in my development environment (which has a non-standard port number and a short domain), and in my staging environment (standard port, regular-looking domain).
I have the same behaviour for live and draft previews.
Firefox 57.