Documentation >> Conditionals >> Cookies >> cookie.[name]
Cookie Conditional Macro: cookie.[name] or cookie.[name].value
Operators:
- == (equal to)
- != (not equal to)
- greaterThan
- greaterThanOrEqualTo
- lessThan
- lessThanOrEqualTo
- beginsWith
- endsWith
- contains
Usage Notes
- You *should* make sure that the cookie exists before testing its value, using cookie.[name].exists
- Tests the current value of cookie present in the client HTTP request.
- Substitute the actual name of a cookie for the [name] (no brackets) portion of the macro.
Examples
This example will show line 1 if a cookie named "wysiwygEditor" has been set to 'false'. Otherwise, line 2 is shown.
<!--#if condition="cookie.wysiwygEditor.exists && ( cookie.wysiwygEditor.value == 'false' )"-->
1. Do not show the WYSIWYG Message editor!
<!--#else-->
2. Either the cookie was set to true, or it wasn't set at all. Show the WYSIWYG editor!
<!--#endif-->
Here is the above code in action:
2. Either the cookie was set to true, or it wasn't set at all. Show the WYSIWYG editor!
View in DG
|