Cookies are actually files containing data that is used by websites to remember user preferences and other relevant information, such as authentication credentials. In some cases, we may need to delete these cookies in order to do the following:
Test if a site detects that the cookies are missing
Test if a site responds according to the browser's configuration (for example, it prompts for approval, and then stores the selection)
Test if a site responds according to the application requirements (for example, prompts for login if an authentication cookie is missing)
There are several ways to achieve deletion of cookies, but here we will show the simplest way with the undocumented WebUtil
object and methods.
Let's take an example. From the File menu, navigate to New | Test, use the Ctrl + N shortcut, or use the Web_Functions.vbs
library you created in the previous recipe, to encapsulate the commands in your own custom functions.