as_cookie_parser: Define a Cookie Parser

View source: R/cookie.R

as_cookie_parserR Documentation

Description

Identifies a function as a cookie parser (see example).

Usage

as_cookie_parser(fn)

Arguments

fn

A function that accepts a single argument, req the Request and returns the parsed cookie string, generally a list. Note that the original cookie string is available on the Request at the HTTP_COOKIE field, get it with: req$HTTP_COOKIE

Examples

func <- function(req) {
 req$HTTP_COOKIE
}

parser <- as_cookie_parser(func)

app <- Ambiorix$new()
app$use(parser)


devOpifex/ambiorix documentation built on Oct. 15, 2024, 10:21 p.m.