anonymize

Learn how to dissociate the current session from a user.

This method anonymizes the visitor, dissociating the session from any previously identified user.

You usually call it when the user logs out. For more information, see Data collection.

Signature

This method has the following signature:

public function anonymize(): void

Example

Here is a basic example of how to use this method:

<?phpuse Croct\Plug\Croct;
$croct = Croct::fromDotenv();$croct->anonymize();