Skip to content

Latest commit

 

History

History
61 lines (30 loc) · 871 Bytes

tough-cookie.cookie.ttl.md

File metadata and controls

61 lines (30 loc) · 871 Bytes

Home > tough-cookie > Cookie > TTL

Cookie.TTL() method

Computes the TTL relative to now (milliseconds).

Signature:

TTL(now?: number): number;

Parameters

Parameter

Type

Description

now

number

(Optional) passing an explicit value is mostly used for testing purposes since this defaults to the Date.now()

**Returns:**

number

Remarks

  • Infinity is returned for cookies without an explicit expiry

  • 0 is returned if the cookie is expired.

  • Otherwise a time-to-live in milliseconds is returned.