- serializeCookie(
name: string,
val: string,
opts?: Partial<
{
domain: any;
encode: (string: any) => string;
expires: any;
httpOnly: boolean;
maxAge: any;
partitioned: any;
path: any;
priority: any;
sameSite: any;
secure: any;
},
>,
): string Parameters
- name: string
- val: string
Optional
opts: Partial<
{
domain: any;
encode: (string: any) => string;
expires: any;
httpOnly: boolean;
maxAge: any;
partitioned: any;
path: any;
priority: any;
sameSite: any;
secure: any;
},
>
Returns string
Serialize data into a cookie header.
Serialize the a name value pair into a cookie string suitable for http headers. An optional options object specified cookie parameters.
serialize('foo', 'bar', { httpOnly: true }) => "foo=bar; httpOnly"