---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [auth](../index.md) / setStoredSession

# Function: setStoredSession()

> **setStoredSession**(`session`): `void`

Defined in: [packages/b2c-tooling-sdk/src/auth/stateful-store.ts:104](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/auth/stateful-store.ts#L104)

Writes a session to the JSON file, creating the directory if needed.

## Parameters

### session

[`StatefulSession`](../interfaces/StatefulSession.md)

## Returns

`void`
