% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stringifySetCookie.R
\name{serialise}
\alias{serialise}
\title{Serialise a Set-Cookie Header}
\usage{
serialise(name, val = NULL, ...)
}
\arguments{
\item{name}{A string with the cookie name, or a list with \verb{$name} and
\verb{$value} elements (in which case \code{val} is ignored).}

\item{val}{A string. The cookie value.}

\item{...}{Additional cookie attributes:
\describe{
\item{\code{encode}}{A function to encode the cookie value. Defaults to
\code{\link[utils:URLencode]{utils::URLencode()}}.}
\item{\code{maxAge}}{An integer. Number of seconds until the cookie expires.}
\item{\code{domain}}{A string. The cookie domain.}
\item{\code{path}}{A string. The cookie path.}
\item{\code{expires}}{A \code{Date}, \code{POSIXct}, or \code{POSIXt}. The expiry date.}
\item{\code{httpOnly}}{Logical. Adds the \code{HttpOnly} attribute.}
\item{\code{secure}}{Logical. Adds the \code{Secure} attribute.}
\item{\code{partitioned}}{Logical. Adds the \code{Partitioned} attribute.}
\item{\code{priority}}{A string: \code{"low"}, \code{"medium"}, or \code{"high"}.}
\item{\code{sameSite}}{A string (\code{"strict"}, \code{"lax"}, \code{"none"}) or logical
(\code{TRUE} maps to \code{"Strict"}).}
}}
}
\value{
A \code{Set-Cookie} header string.
}
\description{
Serialises a cookie name-value pair into a \code{Set-Cookie} header string.
}
\examples{
serialise("session", "abc123")
serialise("id", "42", httpOnly = TRUE, secure = TRUE, sameSite = "lax")

}
