| Recommend this page to a friend! | 
| Info | Documentation | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not yet rated by the users | Total: 20 | All time:  11,349 This week: 206 | ||||
| Version | License | PHP version | Categories | |||
| netscape-cookie 1.0.0 | MIT/X Consortium ... | 5 | HTTP, PHP 5 | 
| Description | Author  | |
This package can store and retrieve cookie values in Netscape files.  | 
composer require mateodioev/netscape-cookie
use Mateodioev\NetscapeCookie\{Config, Cookie, FileHandler};
$cookieJar = new FileHandler((new Config)
  ->setDir(__DIR__.'/cookies', true)
);
$cookieJar->setFileName('cookie.txt')
  ->add(Cookie::create('google.com', true, '/', true, 0, 'test', 'test'))
  ->add(Cookie::create('google.com', true, '/', true, time() + 3600, 'test1', 'test2')
)->save();
Output:
# Netscape HTTP Cookie File
# https://curl.se/docs/http-cookies.html
# File generate by github.com/Mateodioev
google.com	TRUE	/	TRUE	0	test	test
google.com	TRUE	/	TRUE	1666764937	test1	test2
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Lic. | License text | |||
| Doc. | Documentation | |||
| / | src | 
| File | Role | Description | 
|---|---|---|
|    | 
Class | Class source | 
|    | 
Class | Class source | 
|    | 
Class | Class source | 
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
  | 
  | 
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.