vtex / faststore

Digital commerce toolkit for frontend developers
https://faststore.dev
MIT License
182 stars 57 forks source link

Refresh cookie on search #2369

Closed gvc closed 3 weeks ago

gvc commented 3 weeks ago

What's the purpose of this pull request?

While investigating why some events weren't being triggered and tracked on IS Analytics page, @chrsmutti suggested that the proper behavior is to refresh or extend the cookie duration every time a search is made.

How it works?

If the cookie is not expired, we set it again, with the same value, and the same expiry in seconds.

How to test it?

Run core locally, do a search, see the cookie value and its expiry date. Wait for some time, make another search, and see if the cookie value stays the same but the expiry date should have moved forward.

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **faststore-site** | ⬜️ Ignored ([Inspect](https://vercel.com/faststore/faststore-site/8bMKMAdusqkUcGQVHDA6EyCsfgrG)) | [Visit Preview](https://faststore-site-git-feat-refresh-is-cookie-on-search-faststore.vercel.app) | | Jul 4, 2024 0:45am |
codesandbox-ci[bot] commented 3 weeks ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.