netscape-cookie-file-handler icon indicating copy to clipboard operation
netscape-cookie-file-handler copied to clipboard

PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated

Open harryqt opened this issue 2 years ago • 1 comments

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

harryqt avatar Oct 16 '22 04:10 harryqt

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();

harryqt avatar Oct 16 '22 04:10 harryqt