If-So allows you to add, remove, or change a value of a cookie using simple shortcodes.
The action happens when the cookie shortcode is rendered. You can paste the shortcodes directly on a page or inside an If-So content version if you’d like to set the cookie based on a condition.
The Cookie Shortcode is useful together with our Cookie Condition, which allows you to display dynamic content based on a cookie name or cookie value.
The shortcode below will add a cookie to the user’s browser upon rendering
[ifso-add-cookie name='COOKIE_NAME' value='COOKIE_VALUE' time='3600']
A cookie value will be replaced if a shortcode with a different cookie value will be rendered.
Upon rendering, the shortcode below will remove a cookie from the user’s browser
[ifso-remove-cookie name='COOKIE_NAME']