GAM - Auto-register anonymous users - How to identify them

Official Content
This documentation is valid for:

This article describes how to inform if there is no session in the GeneXus Access Manager (GAM) or if the session that exists is anonymous.

It is valid both for auto registered anonymous users and for knowing if the session is anonymous in web applications.

&GAMSession=GAMSession.Get(&GAMErrors) //&GAMErrors: GAMError collection data type / &GAMSession: GAMSession data type

If &GAMSession.IsAnonymous
       //Anonymous user
Else
       //Registered user
Endif

This is how you can find out if the Native Mobile application has an auto-registered user:

If &GAMUser.IsAutoRegisteredUser
       //Anonymous user
Else
       //Registered user
Endif

See Also

GAM - Auto-register anonymous user - Panel usage example