| Recommend this page to a friend! | 
|  Download | 
| Info | Documentation |  Files |  Install with Composer |  Download | 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
|  Files (6) | 
| File | Role | Description | ||
|---|---|---|---|---|
|  src (3 files) | ||||
|    composer.json | Data | Auxiliary data | ||
|    LICENSE | Lic. | License text | ||
|    readme.MD | Doc. | Documentation | ||
|  Files (6) | / | src | 
| File | Role | Description | 
|---|---|---|
|  Config.php | Class | Class source | 
|  Cookie.php | Class | Class source | 
|  FileHandler.php | 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. | 
|  Install with Composer | 
| 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.
 If you know an application of this package, send a message to the author to add a link here.