Fixes undefined variable session

This was triggering error when login with
correct credentials