UNPKG

rjweb-server

Version:

Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS

26 lines (25 loc) 683 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class Cookie { /** * Create a new Cookie * @example * ``` * import { Cookie } from "rjweb-server" * * const cookie = new Cookie('value', { * expires: 50000 * }) * ``` * @since 9.0.0 */ constructor(value, data) { this.value = value; this.domain = data?.domain || null; this.expires = data?.expires || null; this.httpOnly = data?.httpOnly || false; this.path = data?.path || '/'; this.sameSite = data?.sameSite || false; this.secure = data?.secure || false; } } exports.default = Cookie;