---
title: unable_to_create_session
description: The session could not be created during authentication.
---

## What is it?

This error occurs when Better Auth fails to create a session after a successful authentication step. A session is required to keep the user logged in, so failure to create one results in this error.

## Common Causes

* Database write failure when creating the session record.
* Session store misconfiguration.
* Connection issues or timeouts with the database.
* Invalid or missing session-related fields.
* Errors in custom hooks or adapters affecting session creation.

## How to resolve

### Verify database and session storage

* Ensure your database or session store is properly configured and reachable.
* Check for connection errors or timeouts.

### Check schema and migrations

* Confirm that session-related tables/collections exist and are up to date.

### Review configuration

* Verify your Better Auth configuration for session handling.

### Inspect logs

* Look for errors during session creation in server logs.
