Error: This preview token has expired

Hello, I am using prismic for few days, I am really happy with it but I encountered some issues with the Preview feature.

I followed your guide to setup the preview with the ruby kit on my web app and it worked as expected.

But now, randomly, the writer who is using Preview gets some errors with this message on my webapp : "This preview token has expired".

When the error happens, the writer is stuck with it and he's not able to see any of prismic content on my webapp.

Is it a known issue ?
What is the right way to handle this ?
Can you help me ?

Thanks,

Hi Mathieu,

The preview token expires once the saved information has been archived or published. The preview token generated is only valid for the information being previewed at that time. So if the user is viewing an old link after the content has changed then they will see this error.

Also the error can occur when the website user forgets to click the 'X' button on the preview module to exit the preview. If they forget to do this the cookies might not be cleared and so their web browser can receive old preview data.

You can read how to troubleshoot previews here:

Thanks.

1 Like

Hi Phil,

Thank you for your answer.

Yes you are right, I think sometimes the writer forgets to click the X button, so the old cookie is never deleted.

I will try to delete the old cookie manually when this error occurs.

Thanks

1 Like