Login doesn't need to write files, so it's most likely not a file permission issue.
session handler = database is the default and of course login works with it. But this - complemented with having an error only upon deleting the file - points us in another direction: cache.
The Joomla! cache has several layers, but for each, if a hit is found in cache, the component won't be invoked at all. But the file will be included. Hence if you only see the error when the file is not there, Joomla! might be loading the pages from cache.
To prove that the cache is the issue and thus restrict your quest, what happens when you clear the cache? Does the first hit work? If so you know who's responsible.
But Joomla cache is designed to account for user interaction, and login usually works with both or either global cache and page cache turned on.
Which cache handler are you using? Can you try using file? Disabling the page cache (plugins-cache) solves the issue? Are you using external cache handlers or any other system that may be manipulating the post data?