I encountered the same problem after upgrading from Nextcloud “19.0.0.12” to “19.0.1.1”.
At first glance, I also didn’t understand the solution / workaround from https://github.com/nextcloud/server/issues/20490
Then I realized by reading more carefully that the solution was in the following comment :
https://github.com/nextcloud/server/issues/20490#issuecomment-645322499
At the end of this comment, you’ll find the “Update Internal.php” link pointing here :
It will show the fix you have to apply to the “lib/private/Session/Internal.php” file.
Mine is here on my Linux server, but your path might differ if you chose another web root for your installation :
/var/www/nextcloud/lib/private/Session/Internal.php
For safety reasons, I recommend making a backup of this file first.
Then, all you have to do is edit this file and look for the following function :
public function clear() {
$this->invoke('session_unset');
$this->regenerateId();
$this->startSession();
$_SESSION = [];
}
Then you have to comment out the “$this->startSession();” line, for it is the very line causing the bug :
public function clear() {
$this->invoke('session_unset');
$this->regenerateId();
/* $this->startSession(); */
$_SESSION = [];
}
You can also remove this line if you prefer. It’s up to you.
When you’re finished, don’t forget clearing your web browser cache, then just connect to your Nextcloud instance with a regular user and disconnect. Connect back as admin user to check your logs.
The “session_start(): A session had already been started” error should not be thrown again.