If the new User is NOT logged in after a registration, the calling of updateSession() in the User::afterSave() or Profile::afterSave() function will result in an error: 'Trying to get property of non-object'.
I think a check is in order to verify the current user is not a guest, before running updateSession.
If the new User is NOT logged in after a registration, the calling of updateSession() in the User::afterSave() or Profile::afterSave() function will result in an error: 'Trying to get property of non-object'.
I think a check is in order to verify the current user is not a guest, before running updateSession.