Skip to main content

Netscape cookie file format

🔗 Original page — Source of this material


List of parameters

#NameTypeDescription
0domainstringCookie file domain (for example, www.google.com, example.com).
1isDomainbooleanReserved. Not used. However, you must still provide a value.
2pathstringCookie file path.
3securebooleanTRUE if the cookie is marked as secure (i.e., its scope is limited to secure channels, usually HTTPS).
4expirationDateDateTimeFormat: mm/dd/yyyy hh:mm:ss. This value is optional. However, it only makes sense if session=true.

You can also specify the Unix format — number of seconds since 1970.1.1 0:0:0
5namestringCookie file name.
6valuestringCookie file value.
7*httpOnlybooleanTRUE if the cookie is marked as HttpOnly (i.e., it is inaccessible to client scripts). Default value is FALSE.
8*sessionbooleanTRUE if the cookie is marked as a session cookie (i.e., it will be deleted after the browser is closed). Default value is FALSE.
9**sameSiteenumSameSite status for the cookie (i.e., whether the cookie is sent with cross-site requests). Values: Lax, Strict, None, Extended, Unspecified. Default is Unspecified
10***priorityenumSets the priority for deleting cookies when the storage is full. Values: Low, Medium, High. Default is Medium
Information

You may omit the values marked with an asterisk. Values with the same number of asterisks must be specified together (i.e., if you provide the httpOnly parameter, you must also provide the session parameter).

Sample export

some.host.io	TRUE	/	TRUE cookie-name-1	cookie-value-1	TRUE	TRUE	None	Strict
some.host.io TRUE / TRUE 01/01/2023 00:00:00 cookie-name-2 cookie-value-2 TRUE FALSE
some.host.io TRUE / TRUE 01/01/2024 00:00:00 cookie-name-3 cookie-value-3
Information

Parameters should be separated by the tab character (\t). Each cookie file should be separated by EOL (end of line — \r\n)