# 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](/reference/sdk/php/api/storage/cookie-storage) used by default and an [in-memory store](/reference/sdk/php/api/storage/in-memory-identity-store) for tests. You can also implement it to store the session your own way.

## Usage

Provide an implementation [when you create the SDK](/reference/sdk/php/api/core/croct/plug):

```php
<?php
use Croct\Plug\Croct;
use Croct\Plug\CookieStorage;

$croct = Croct::plug(
    appId: 'APPLICATION_ID',
    apiKey: 'API_KEY',
    storage: CookieStorage::fromGlobals(),
);
```

## Implementations

- [CookieStorage](/reference/sdk/php/api/storage/cookie-storage): Stores the session in cookies.
- [InMemoryIdentityStore](/reference/sdk/php/api/storage/in-memory-identity-store): Stores the session in memory.
