Yes, i also faced this problem, what i did was if file size was > 100kb then i delete cookies and bot will check if cookies are not present then it will call login function and new cookies file will be saved which will be less than 100 kb.
Your threading issues get me so curious! You'll need to start sending your projects(s) into @Fox or @support so they can dissect the code to find the cause of these effects bud.