File format

The cookie file format is text based and stores one cookie per line. Lines that start with # are treated as comments.

Each line that specifies a single cookie consists of seven text fields separated with TAB characters (ASCII octet 9). A valid line must end with a newline character.

Fields in the file

NumberType ExampleDescription
stringexample.comthe domain name
booleanFALSEinclude subdomains
string/foobar/path
booleanTRUEsend/receive over HTTPS only
number1462299217expires at - seconds since Jan 1st 1970, or 0
stringpersonname of the cookie
stringdanielvalue of the cookie

Example

The following example was generated by crawling the WebCopy cookies demonstation page and demonstrates a mixture of different cookie attributes.

# Netscape HTTP Cookie File
# Generated by Cyotek WebCopy v1.9.1.0 on 2023-03-13T10:13:33
# Edit at your own risk.

demo.cyotek.com	FALSE	/features/	FALSE	1678706015	CrawlDemo_Path	gamma
demo.cyotek.com	FALSE	/	FALSE	1678706015	CrawlDemo_Domain	delta
demo.cyotek.com	FALSE	/	TRUE	1678706015	CrawlDemo_Secure	epsilon
#HttpOnly_demo.cyotek.com	FALSE	/	FALSE	1678706015	CrawlDemo_HttpOnly	zeta
demo.cyotek.com	FALSE	/features/	FALSE	0	CrawlDemo_Session	alpha
demo.cyotek.com	FALSE	/	FALSE	0	PHPSESSID	eo74gbd2lcu675r338so6q7g40
demo.cyotek.com	FALSE	/features/cookies.php	FALSE	1678706015	CrawlDemo_Expires	beta
demo.cyotek.com	FALSE	/features/cookies.php	FALSE	1678706015	CrawlDemo_Song	I%2520am%2520the%2520very%2520model%2520of%2520a%2520modern%2520Major-General%252C%250D%250AI%2527ve%2520information%2520vegetable%252C%2520animal%252C%2520and%2520mineral%252C%250D%250AI%2520know%2520the%2520kings%2520of%2520England%252C%2520and%2520I%2520quote%2520the%2520fights%2520historical%250D%250AFrom%2520Marathon%2520to%2520Waterloo%252C%2520in%2520order%2520categorical%253B%250D%250AI%2527m%2520very%2520well%2520acquainted%252C%2520too%252C%2520with%2520matters%2520mathematical%252C%250D%250AI%2520understand%2520equations%252C%2520both%2520the%2520simple%2520and%2520quadratical%252C%250D%250AAbout%2520binomial%2520theorem%2520I%2527m%2520teeming%2520with%2520a%2520lot%2520o%2527%2520news%252C%250D%250AWith%2520many%2520cheerful%2520facts%2520about%2520the%2520square%2520of%2520the%2520hypotenuse.%250D%250A%2509%2509%2509

Note

Content derived from Cookie file format licensed under CC BY 4.0. Premable removed, field list converted to table, documentation link comment removed, example added.

See Also

© 2010-2024 Cyotek Ltd. All Rights Reserved.
Documentation version 1.9 (buildref #182.15707), last modified 2024-03-15. Generated 2024-03-15 22:36 using Cyotek HelpWrite Professional version 6.19.1