HttpCookie Module

Functions and values

Function or value Description

create name value expires path domain secure httpOnly sameSite

Full Usage: create name value expires path domain secure httpOnly sameSite

Parameters:
    name : string
    value : string
    expires : DateTimeOffset option
    path : string option
    domain : string option
    secure : bool
    httpOnly : bool
    sameSite : SameSite option

Returns: HttpCookie

Create a new `HttpCookie` with all the given values.

name : string
value : string
expires : DateTimeOffset option
path : string option
domain : string option
secure : bool
httpOnly : bool
sameSite : SameSite option
Returns: HttpCookie

createKV name value

Full Usage: createKV name value

Parameters:
    name : string
    value : string

Returns: HttpCookie
 Create a new cookie with the given name, value, and defaults:

 - no explicit expiry time
 - path at "/", so that it's global to the domain that it's created under.
 - no specific domain (defaults to the current domain plus its subdomains)
 - `secure = false` (you can set it over plain text HTTP - change to true in SSL terminator)
 - `httpOnly = true` - the cookie can be read from JS - change this to
   false if you want to only be able to read the cookie from JS, but
   Good default if you're implementing session handling.
 - `version`: an optional version field

 More reading:
 - http://www.nczonline.net/blog/2009/05/05/http-cookies-explained/
 - https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
name : string
value : string
Returns: HttpCookie

empty

Full Usage: empty

Returns: HttpCookie

An empty cookie value

Returns: HttpCookie

toHeader cookie

Full Usage: toHeader cookie

Parameters:
Returns: string

Assumes only valid characters go in, see http://tools.ietf.org/html/rfc6265#section-4.1.1

cookie : HttpCookie
Returns: string