System Function canSetCookie()

function canSetCookie()

Name in Zenario 8



You should call this function before placing a cookie on a visitor's computer.

Where You Can Use It

From Zenario 7.0.0 onwards.


Different sites may wish to set different rules as to when they can place a cookie on a visitor's computer.

Some sites may have no restrictions, and will always allow this if cookies are enabled. Some sites may not allow cookies to be placed until they accept a prompt (which is provided by the CMS).

If you wish to place a cookie in your Module, you should first call this function to check to see if this is allowed.

Return Value

This function will return true if a visitor has given their consent to cookies, or if the cookie consent feature is not enabled in the Site Settings.

This function will return false if a visitor has not yet accepted the prompt, or if they rejected the prompt.