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.