Search code examples
xpages

Convert cookies to scope values


How do I access the cookies and make them into scope variables? I can get the cookies but I am at a loss for how/when/where to create scope variables for each one once I have them


Solution

  • The key is how early you can get the cookies. I don't know if the map is filled at beforePageLoad or afterPageLoad. From there you can iterate the map (use keySet()) and create / update in sessionScope or viewScope. You just need to bear in mind sessionScope may be shared across browser tabs.