UNPKG

rjweb-server

Version:

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

23 lines (22 loc) 595 B
export default 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; } }