cbstorages

Persist cross-request data in ColdBox and BoxLang with pluggable storage adapters.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill cbstorages
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cbstorages
Source: https://github.com/ColdBox/skills/tree/main/modules/cbstorages
Command: npx skills add https://github.com/ColdBox/skills --skill cbstorages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a unified, pluggable API for persisting data across HTTP requests in ColdBox/BoxLang so applications can manage session state, cookies, cache entries, request-scoped values, and application-wide storage without duplicating adapter-specific code or leaking sensitive data.

Core Features & Use Cases

  • Universal get/set/exists/delete/clear API across Session, Cookie, Cache, Request, and Application adapters to simplify persistence logic.
  • Built-in support for TTLs, cookie attributes (secure, httpOnly, sameSite), encryption for sensitive values, and dependency-injection friendly adapters for seamless integration.
  • Practical patterns and examples for shopping carts (session-backed), user preference cookies (optionally encrypted), and API token caching (cache-backed with TTL).

Quick Start

Store and retrieve a user's shopping cart in sessionStorage with encryption enabled and a 30-minute TTL.

Frequently Asked Questions about cbstorages

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I persist data across HTTP requests in ColdBox without duplicating adapter code?

You can persist cross-request data in ColdBox using a unified, pluggable API that manages session, cookie, cache, and application storage without duplicating adapter-specific code or leaking sensitive data.

Can I encrypt session storage for shopping carts in ColdBox?

Yes, session storage can be encrypted for shopping carts in ColdBox. The storage API supports built-in encryption for sensitive values and allows you to set a TTL to automatically expire the data.

What's the best way to cache API tokens with a TTL in BoxLang?

The best way to cache API tokens in BoxLang is using cache-backed storage adapters. These adapters support time-to-live configurations, allowing tokens to persist securely across requests and expire automatically.

Does cross-request storage support secure cookie attributes like httpOnly and sameSite?

Yes, cross-request storage supports secure cookie attributes. You can configure httpOnly, sameSite, and secure settings directly through the cookie storage adapter when managing user preferences.

How do I manage user preferences with cookies in a ColdBox application?

You manage user preferences in ColdBox by using the cookie storage adapter. It provides universal get, set, exists, delete, and clear operations, with optional encryption to protect the stored preference data.

Can I use dependency injection with ColdBox storage adapters?

Yes, ColdBox storage adapters are dependency-injection friendly. This allows you to seamlessly inject and manage session, cache, cookie, request, and application storage components throughout your application.