Cookie

A cookie. Use Cookie("key", "value") to create a cookie. You can chain methods.

auto cookie = Cookie("name", "value").path("/").domain("example.com").secure().maxAge(1.days);
output.setCookie(cookie);

Constructors

this
this()
Undocumented in source.
this
this(string name, string value)

Build a cookie with name and value

Members

Enums

SameSite
enum SameSite

Cookie SameSite flag

Properties

domain
string domain [@property setter]

Set cookie domain

expire
SysTime expire [@property setter]

Set cookie expire time. It overrides maxAge.

httpOnly
bool httpOnly [@property setter]

Set cookie httpOnly flag. This cookie will not be accessible from javascript.

invalidate
Cookie invalidate [@property getter]

Invalidate cookie. It will be deleted from browser on output.setCookie() request.

maxAge
Duration maxAge [@property setter]

Set cookie max age. It overrides expire.

path
string path [@property setter]

Set cookie path

sameSite
SameSite sameSite [@property setter]

Set cookie SameSite flag

secure
bool secure [@property setter]

Set cookie secure flag. This cookie will be sent only thru https.

Meta