The users who have reported the problem on my website says it works when they try to login using their cellphone but they got the error using their laptop.
I use the plugin WP Fastest Cache and when I manually have reseted the cache the problem disappears until the next day they try to login. Then it is back and I need to clear the cache again. So it might have to do with the combination of these plugins in my case.
The problem started with updating to the latest version of Ultimate Member last Friday though.