After some number of cookies is set (for me, about 20-30), cookies() stops returning the truth and starts returning an empty list. Test case below. Run and hit refresh in your browser until you get 0. Then check that in fact your browser has (and is sending) the right number of cookies. Tested in Firefox and Chrome.
library(Rook)
app <- function (env) {
r <- Rook::Request(env)
cookies <- r$cookies()
res <- Rook::Response$new()
res$set_cookie(paste0("foo", sample(100000,1)), paste0("bar",sample(100000,1)))
res$write("<html><body>");
res$write(paste("I can see", length(cookies), "cookies in your last request..
adding another one with random name and content</body></html>"))
res$finish()
}
svr <- Rhttpd$new()
rhapp <- RhttpdApp$new(name="cookies", app=app)
svr$add(rhapp)
require(tools)
svr$start(port=35538)
Rook packageVersion: 1.1.1. R version: 3.1.1.
After some number of cookies is set (for me, about 20-30), cookies() stops returning the truth and starts returning an empty list. Test case below. Run and hit refresh in your browser until you get 0. Then check that in fact your browser has (and is sending) the right number of cookies. Tested in Firefox and Chrome.
Rook packageVersion: 1.1.1. R version: 3.1.1.