{% unset_session %}

Unsets custom properties from the user session.

Syntax

{% unset_session [property1] [property2] [etc...] %}

You may also include reference variables, which will be dereferenced to their property names before unsetting the session properties.

If no properties are specified, then ALL custom session properties will be unset

Examples

{% if client_permissions.do_not_track %}
    {% unset_session %}
{% endif %}
{% if request.query_params.ad_setting == "false" %}
    {% set_client_permission deny ads %}
    {% unset_session facebook_advertiser_id google_ads_id other_third_party_ids %}
{% endif %}
{% var props = request.query_params.clearprops | split: ',' %}
{% for prop in props %}
    {% unset_session &prop %}
{% endfor %}

Developer Overview

Liquid Markup