diff --git a/src/Cookie/FileCookieJar.php b/src/Cookie/FileCookieJar.php index 9887c1d54..0de809099 100644 --- a/src/Cookie/FileCookieJar.php +++ b/src/Cookie/FileCookieJar.php @@ -56,7 +56,7 @@ public function save($filename) } $jsonStr = \GuzzleHttp\json_encode($json); - if (false === file_put_contents($filename, $jsonStr)) { + if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) { throw new \RuntimeException("Unable to save file {$filename}"); } }