prismicio / prismic-toolbar

An embeddable UI for Prismic content and previews directly on your website.
12 stars 19 forks source link

Can't close a preview session #61

Closed francois-riviere closed 4 years ago

francois-riviere commented 4 years ago

Users on Intercom have reported that they can't close the preview Session when clicking on the small cross:

Intercom Threads:

First Investigation:

I could reproduce the issue on my personal sample just by having the script on my webpage, nothing more.

After watching how it interacts on my cookie inspector, it seems that some the "io.prismic.previewSession" cookie is never deleted.

When you click on the cross, what happens:

After checking the code of the toolbar, the function that delete the "io.prismic.previewSession" cookie is called "demolishCookie" and is located in src/common/cookie.js

This demolish function has never been changed before so I don't think it is the issue here.