Hello,
I have found a solution, it indeed has to do something with the sessions. Apparently the session was not started.
When I add session()_start; at the top of the login page. The authentication works (also your little session test) and I can go editing records.
I offcource get a notice on...