Skip to content

cookies() method fails to work with too many cookies #26

Description

@hughjonesd

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions