Remove Cookie

Definition:

NDLLibrary.removeCookie(cookieName)

 

Description:

Delete a cookie.

 

Parameters:

This function has one parameter:

cookieName - Required

The name of the cookie you want to delete. The name is case-sensitive.

Note: This function does not use the default ndlParams object.

 

Returns:

true

 

Code Sample:

var cookieName="myCookie";

return NDLLibrary.removeCookie(cookieName);

 

Notes:

If you use cookies in your form, you must display an appropriate warning message within the form and allow users to refuse the use of cookies.

 

Using as Predefined Action in Event:

When assigned to an Event as a predefined action, you will need to generate a JavaScript function and then edit the skeleton script created to specify the name of the cookie. Edit the automatically generated code:

return NDLLibrary.removeCookie(ndlParams);

so it matches the two lines shown in the code sample above, replacing myCookie with the cookie name, leaving the double quotes around it.

Alternatively you can enter the cookie name directly in the original code, in place of ndlParams, e.g.:

return NDLLibrary.removeCookie("myCookie");

Note that if you enter the name directly, it must be surrounded by double quotes.

 

 


See also:

Set Cookie

Get Cookie