netscape-cookie-file-handler
netscape-cookie-file-handler copied to clipboard
PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
PHP version: 8.1.11
PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /vendor/kegi/netscape-cookie-file-handler/src/NetscapeCookieFileHandler/Parser/Parser.php on line 118
Also how do I access cookies? Can you give some examples?
For example I want to get all cookie name and value as array.
$configuration = (new Configuration())->setCookieDir('cookies/');
$cookieJar = (new CookieFileHandler($configuration))->parseFile('cookies.txt');
// This returns object. How do I access cookie?
$cookies = $cookieJar->getAll();