Get a named cookie

Share:

Description

getNamedCookie Get the cookie with a given name.

Usage

1

Arguments

remDr

An object of class "rDriver". A remote driver object see remoteDr.

name

character: The name of the cookie; may not be null or an empty string

...

Additonal function arguments - Currently passes the retry argument.

Value

A named cookies from the current domain is returned if it exists. These cookies have values as stipulated by the arguments given in addCookie.

See Also

Other cookies functions: addCookie, deleteAllCookies, deleteCookie, getAllCookies

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
# assume a server is running at default location
remDr <- remoteDr()
remDr %>% go("https://www.google.com/ncr") %>%
  getTitle()
# get the cookies
remDr %>% getCookie()
# get a named cookie
remDr %>% getCookie("NID")
# add our own cookie
remDr %>% addCookie(name = "myCookie", value = "12")
# check its value
remDr %>% getCookie("myCookie")
# delete our cookie
remDr %>% deleteCookie("myCookie")
# check its deleted
remDr %>% getCookie("myCookie")

# delete all cookies
remDr %>% getCookie()
remDr %>% deleteAllCookies() %>%
  getCookie()

remDr %>% deleteSession()

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.