Browser.clearCookies() documentation states that all cookies will be deleted, but that doesn't happen #159

Closed
geb-bot opened this Issue Dec 23, 2011 · 7 comments

Projects

None yet

2 participants

@geb-bot
geb-bot commented Dec 23, 2011

Originally created by Hans Westerbeek.

In Browser.groovy:

/** * Clears all cookies that the browser currently has. */ void clearCookies() { driver?.manage()?.deleteAllCookies() }

This invokes a method on an implementor of WebDriver Options interface:
/** * Delete all the cookies for the current domain. */ void deleteAllCookies();

Update documentation to be clear on what clearCookies() actually does. Possibly provide clearCookies(String domains).

@geb-bot
geb-bot commented Dec 23, 2011

Originally posted by Hans Westerbeek.

By the way I would like for clearCookies() to do what it suggests: clear all cookies, regardless of domain, url etc.

If people need to delete specific cookies they can do that through the WebDriver API

@geb-bot
geb-bot commented Apr 11, 2012

Originally posted by Luke Daley.

What was the case where you needed to do this?

@geb-bot
geb-bot commented Apr 11, 2012

Originally posted by Hans Westerbeek.

I was testing a system that consisted of multiple webapps, and I had to be sure that between tests, all (session id) cookies would be deleted

@geb-bot
geb-bot commented Aug 22, 2013

Originally posted by Sean Gilligan.

I'm using OAuth (e.g. Twitter) and the Facebook JS SDK. To properly test interactions I need to clear all cookies. The documentation should make it clear that deleteAllCookies() doesn't delete all cookies. An example of how to clear all cookies by clearing the driver cache would be helpful, too.

And, of course, a clearAllCokiesAllDomains() method would be the best solution of all.

@geb-bot
geb-bot commented Aug 31, 2013

Originally posted by Marcin Erdmann.

Yes, the documentation needs to be indeed updated with regard to that.

I don't think we will be able to provide a method that automatically clears all the cookies from all the domains that were visited as it's hard if not impossible to track all the domains that were visited. I will modify the issue to add clearCookies(String... domains) though.

@geb-bot
geb-bot commented May 19, 2014

Originally posted by David Carr.

Any updates on this? We just ran into it.

@geb-bot
geb-bot commented May 19, 2014

Originally posted by Marcin Erdmann.

It's scheduled to be fixed in the next version and there's a burst of development coming into Geb at the moment so it should be worked on soon.

Pull requests are more than welcome. ;)

@geb-bot geb-bot added the Bug label Apr 12, 2015
@geb-bot geb-bot added this to the 0.10.1 milestone Apr 12, 2015
@erdi erdi modified the milestone: 0.10.1 Jul 11, 2015
@erdi erdi added this to the 1.0 milestone Aug 20, 2015
@erdi erdi modified the milestone: 1.0 Dec 29, 2015
@erdi erdi added a commit to geb/geb that closed this issue Jan 17, 2016
@erdi erdi Document that clearing cookies only happens for the current domain, a…
…dd a method for clearing cookies for additional domains.

Closes geb/issues#159.
99bf086
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment