diff --git a/net-doc/net/scribblings/cookies.scrbl b/net-doc/net/scribblings/cookies.scrbl index 145ee0d3f8..d3727583d5 100644 --- a/net-doc/net/scribblings/cookies.scrbl +++ b/net-doc/net/scribblings/cookies.scrbl @@ -170,16 +170,10 @@ HttpOnly} for more info.) @examples[ #:eval cookies-server-eval (clear-cookie-header "rememberUser" #:path "/main") - (require racket/date) - (date->string (seconds->date (current-seconds) #f) #t) ] } -@defstruct*[(exn:fail:cookie exn:fail) ()]{ -Raised when a cookie (or component thereof) is malformed or can't be parsed. -} - @defproc*[([(cookie-header->alist [header bytes?]) (listof (cons/c bytes? bytes?))] [(cookie-header->alist [header bytes?] @@ -189,10 +183,8 @@ Raised when a cookie (or component thereof) is malformed or can't be parsed. alist of all cookie name/value mappings in the header. If a @racket[decode] function is given, applies @racket[decode] to each key and each value before inserting the new - key-value pair into the alist. Raises an - @racket[exn:fail:cookie] if the header can't be parsed into - a sequence of name/value pairs (but does not check that the - byte-string obeys all the cookie formatting requirements). + key-value pair into the alist. Invalid cookies will not + be present in the alist. If a key in the header has no value, then @racket[#""], or @racket[(decode #"")] if @racket[decode] is present, is @@ -209,7 +201,6 @@ Raised when a cookie (or component thereof) is malformed or can't be parsed. } - @defproc[(cookie->string [c cookie?]) string?]{ Produces a string containing the given cookie as text. diff --git a/net-lib/net/cookies/server.rkt b/net-lib/net/cookies/server.rkt index 9331ef145f..3d9d698265 100644 --- a/net-lib/net/cookies/server.rkt +++ b/net-lib/net/cookies/server.rkt @@ -34,10 +34,6 @@ bytes?)] [cookie->string (-> cookie? string?)] - (struct (exn:fail:cookie exn:fail) - ([message string?] - [continuation-marks continuation-mark-set?])) - #:forall X [cookie-header->alist (case-> (-> bytes? (listof (cons/c bytes? bytes?))) @@ -82,10 +78,6 @@ #:path path #:domain domain))) -;; For failure to parse a cookie on the server side: -;; FIXME I'm not sure I like raising exns for this. -(struct exn:fail:cookie exn:fail ()) - ;; bytes? [(bytes? -> A)] -> (AList A A) ;; Given the value from a Cookie: header, produces an alist of name/value ;; mappings. If there is no value, the empty byte-string (or whatever