diff --git a/src/Cookie/FileCookieJar.php b/src/Cookie/FileCookieJar.php
index <HASH>..<HASH> 100644
--- a/src/Cookie/FileCookieJar.php
+++ b/src/Cookie/FileCookieJar.php
@@ -56,7 +56,7 @@ class FileCookieJar extends CookieJar
         }
 
         $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}");
         }
     }
Prevent concurrent writes 

Concurrent writes might lead to invalid JSON being saved in the cookie jar.