Learn R Programming

fiery (version 1.3.0)

session_id_cookie: Use a session cookie to store the id of the session

Description

This function constructs an ID extractor for incoming requests, the return value of which will be passed to the id argument of request, header, message etc handlers. By default, fiery uses this with default arguments.

Usage

session_id_cookie(name = "fiery_id", secure = FALSE)

Value

A unary function taking a Request object and returning an ID for it

Arguments

name

The name of the cookie to store the session id in

secure

Should the session id only be send over HTTPS? Setting this to TRUE will require setting up a proxy manager with SSL support in front of your fiery server.

Details

A session id is looked for in the cookie matching the name arg. If it is found then the value of the cookie is returned. If it is not found then an id is generated with reqres::random_key() and attached to the response as a cookie with the given name. The cookie is set to HTTP only and Strict same site policy. Depending on secure it also sets it to only be transferred over HTTPS.