Implement session handling and store the authenticated user into g.user