web_response->setCookie

Sets a response cookie.

Target member

Signature

1web_response->setCookie(nv::pair, ...)

Sets a response cookie.

web_response->setCookie is called with member syntax on a receiver value. web_response->setCookie belongs at the request or response boundary. Treat visitor input as untrusted, validate before use, and encode values before writing them into HTML.

Parameters

nv
Required value of type pair. Supply nv positionally unless the signature shows a keyword form.
...
Additional values may be supplied after the earlier arguments.

Examples

Basic call

1web_response->setCookie('notice'='ok')
The example belongs near a request or response boundary; validate visitor input before trusting it.