# netscape-cookie-file-parser
Parser for Netscape/curl cookie jar files.
Netscape cookie files are line-oriented and store seven tab-separated fields:
domain, tail-match flag, path, secure flag, expires, name, and value. This
crate keeps string-like fields as byte buffers so non-UTF-8 cookie jar data can
be represented without UTF-8 conversion.
By default, `parse` removes one leading dot from the domain field, accepts
curl's legacy missing-path records with `/` as the path, and preserves ordinary
path fields as they appear in the file.
```rust
use std::io::Cursor;
use netscape_cookie_file_parser::{parse, CookiePrefix};
let jar = Cursor::new(br#"
# Netscape HTTP Cookie File
.example.com TRUE /foo FALSE 0 public yes
#HttpOnly_.example.com TRUE / TRUE 0 __Secure-SID abc
"#);
let cookies = parse(jar).unwrap();
assert_eq!(cookies.len(), 2);
assert_eq!(cookies[0].domain, b"example.com");
assert_eq!(cookies[0].name, b"public");
assert_eq!(cookies[0].path, b"/foo");
assert!(cookies[1].http_only);
assert_eq!(cookies[1].prefix, CookiePrefix::Secure);
```