Move session_regenerate_id to `login()`
Remove `session_id_regenerate` from here

Jenkins somewhat complains that there are already sent headers.
Merge branch 'master' into patch-headers-already-sent
Merge pull request #7347 from owncloud/patch-headers-already-sent

Fix "headers are already sent" introduced with #6519