Concretio

View Original

How to read cookies set by JavaScript in Apex/Visualforce controller !

This might be a requirement, if you are developing some complex navigation, for ex.

  • User lands on a visualforce page  “A”

  • from here user is redirected to some other page “B”

  • Now when user returns to page “A” you want to make sure, some operations are done on page “B”, of course one can create database records for the same. But that might be too much to maintain for some trivial tracking requirements. So Cookies seems to be a good fight in this scenario, if some desired operation is done on page “B” a cookie can be set, that in turn can be read by Apex Controller at page “A”.

Read More: https://abhinav.fyi/how-to-read-cookies-set-by-javascript-in-apex-visualforce-controller/