Overview

Learn how the SDK persists the visitor session.

This interface abstracts the mechanism used to persist the visitor session, such as the client ID and user token, across requests.

The SDK ships a cookie-based store used by default and an in-memory store for tests. You can also implement it to store the session your own way.

Usage

Provide an implementation when you create the SDK:

<?phpuse Croct\Plug\Croct;use Croct\Plug\CookieStorage;
$croct = Croct::plug(    appId: 'APPLICATION_ID',    apiKey: 'API_KEY',    storage: CookieStorage::fromGlobals(),);