Menu
Feedback
Start here
Tutorials
Developer portal

Known Issues
Support Rules
Troubleshooting

Frequently Asked Questions
Announcements
Known issues
Segment Cookie updated only after refreshing the page
Segment Cookie updated only after refreshing the page
ID: 647116
Backlog
Published on 11/1/2022
Last update on 1/10/2024

Summary

Some VTEX features and components can use data requested from the Segment Cookie to present information (like price, promotion data, SKU availability, etc) in the storefront. This cookie is stored in the user's browser when the session is created. Sometimes, mostly in dynamic scenarios where it needs to make changes in the front where it triggers a Cookie Segment update, the cookie itself loses some data which is a of a behavior in render-runtime that doesn't trigger segment change to the context

How to retrieve Session info: https://developers.vtex.com/vtex-rest-api/reference/getsession

You can get the Segment Cookie data through the segment token:

  • Open the browser's console;
  • Decode the segment token presented in the render runtime object;
  • In the console, run: atob(__RUNTIME__.segmentToken)
    {"base64":"  ","img":{"width":758,"height":61,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":24211,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/known-issues/Store%20Framework/segment-cookie-updated-only-after-refreshing-the-page_1.png"}}

Simulation

  • Select a store that presents information based on a Segment Cookie data:
  • Ex.: Different prices are shown based on the customer identification - related to pricing tables;
  • Get the Cookie Segment data in different scenarios using the app that retrieves the user identification;

Workaround

Refresh the page

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX community.
Join our community
Request support from VTEX
For personalized assistance, contact our experts.
Open a support ticket
GithubDeveloper portalCommunityFeedback