How can I have multiple cookies for each Client/PC to run a script?
If ComputerA run a script then cookies.txt will be created and also ComputerB run same Script then cookies.txt will be over written which is bad.
Example:
curl_setopt($ch,CURLOPT_COOKIEFILE,"cookie.txt");
curl_setopt($ch,CURLOPT_COOKIEJAR,"cookie.txt");
If they're seperate computers, then it's seperate file systems and each will have its own cookie file.
But if you're on shared storage, then use a dynamic filename, perhaps
'cookie-' . $_SERVER['SERVER_NAME'] . '.txt'
instead, which'd give you
cookie-ComputerA.txt cookie-ComputerB.txt etc...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With