Sahi Documentation

How to delete cookies

The following code can be used in a Sahi test script to delete cookies for a site.

Example: Let us assume that we want to delete cookies for www.yahoo.com domain.

_navigateTo("http://www.yahoo.com/_s_/dyn/Cookies_showAll"); // Shows all cookies for www.yahoo.com domain.
_check(_checkbox("_sahi_chooseAll")); // Click the checkbox to choose all cookies.
_click(_button("Delete")); // Delete the cookies.
_navigateTo("http://www.yahoo.com/_s_/dyn/Cookies_showAll"); // Shows all cookies again so that you can verify that all cookies have been deleted.


Change www.yahoo.com to the domain you want to delete cookies for, as per your needs.

More details on Cookie Manager