---
name: "libressl-SSL_CTX_sessions"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-SSL_CTX_sessions"
---

# libressl-SSL\_CTX\_sessions(3)

access internal session cache

## NAME

**SSL\_CTX\_sessions** – access internal session cache

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

**#include \<openssl/ssl.h\>**

*LHASH\_OF(SSL\_SESSION)* *\**\

**SSL\_CTX\_sessions**(*SSL\_CTX \*ctx*);

## DESCRIPTION

**SSL\_CTX\_sessions**() returns a pointer to the lhash databases containing the internal session cache for *ctx*.

The sessions in the internal session cache are kept in an lhash-type database (see lh\_new(3)). It is possible to directly access this database, e.g., for searching. In parallel, the sessions form a linked list which is maintained separately from the lhash operations, so that the database must not be modified directly but by using the SSL\_CTX\_add\_session(3) family of functions.

## SEE ALSO

lh\_new(3), [ssl(3)](/ssl/3.md), SSL\_CTX\_add\_session(3), SSL\_CTX\_set\_session\_cache\_mode(3)

## HISTORY

**SSL\_CTX\_sessions**() first appeared in SSLeay 0.5.2 and has been available since OpenBSD 2.4.
