sparkledriver.cookies

browser-cookies->map

(browser-cookies->map browser)

Convert browser’s current cookies into the map format used by clj-http. This returns cookies from all domains, but cookie names that are set on multiple domains will only be returned once.

delete-all-cookies!

(delete-all-cookies! browser)

Clear all cookies from all domains.

delete-cookie!

(delete-cookie! browser name)(delete-cookie! browser name domain)

Delete the named cookie from the given domain. When omitted domain defaults to the browser’s current domain.

set-cookie!

(set-cookie! browser name value & {domain :domain, :as options})

Set a cookie with given name and value. If a cookie with the same name and domain is already present, it will be replaced. The following keyword arguments are supported.

  • :domain (String) The cookie domain, defaults to the current domain of the browser.
  • :expires-on (java.util.Date) Expiration date. Must be in the future or the cookie won’t be stored.
  • :http-only (Boolean) Cookie’s HttpOnly flag, disallow access from JavaScript
  • :secure (Boolean) Cookie’s Secure flag, only serve over HTTPS.
  • :path (String) URL path of the cookie.