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.
Create a variable called "counter". Than use "is element exist" to check if element exist and update "counter" variable whenever element is missing. Check counter variable in the loop, and fail thread if "counter" hit 3