bynk.http.cookie_field_arity
Error A typed cookie write or deletion (Record.field.cookie(v), Record.field.expire()) is given the wrong number of arguments.
Record.field.cookie(value) writes a typed cookie from a record's field, so it takes exactly the value to write, and Record.field.expire() takes nothing: the field is named by the path, not by an argument. Write Prefs.theme.cookie(Dark) to set it and Prefs.theme.expire() to remove it.
Example
Ok("x").withCookie(Prefs.theme.cookie()) // ✗ the value to write is missing
Ok("x").withCookie(Prefs.theme.cookie(Dark)) // ✓In the Book
See also
- The grammar rule it governs:
http_handler. - Every code in its category, HTTP, on the diagnostic index.
bynk explain bynk.http.cookie_field_arityshows the same from the installed toolchain, without a network.