Anonymous test

Learn how to check if the user is anonymous.

This test checks whether the user is anonymous, that is, whether they have not logged in or signed up yet. It is the opposite of the identified test.

Users are anonymous until they log in or sign up. After that, they remain identified until they log out.

Syntax

This test has the following syntax:

/*<user>*/ is anonymous
Try in Playground

To negate the test, you can write:

/*<user>*/ is not anonymous
Try in Playground

Consider using the identified test instead of negating this test for better readability.

Parameters

These are the supported parameters:

user

The user to check whether they are anonymous.

Examples

You can check whether a user is anonymous like this:

user is anonymous
Try in Playground