What is the cookies.set(...) // set cookie about?

Hi everyone,

I followed the nodeJS documentation to integrate live preview here : https://prismic.io/docs/nodejs/beyond-the-api/previews-and-the-prismic-toolbar
It works fine, but I have no idea what the line cookies.set(...) // set cookie means, which cookie should I set ?

Thanks

1 Like

Hey Philippe,

Maybe the documentation is very clear, the cookies being set are coming from Prismic. That's how the preview is created, these cookies are loaded on top of your website application in the browser, thus requiring no rebuild.

I think it's maybe clearer in our Node.js website example as to how you should set up the preview route.

I'll make a note to update the documentation.

Thanks.

Thanks for your answer, from what I understand, I do not need to set the cookie, it is set by the getPreviewResolver method ?

That's correct, this is handled for you.