getSessionDir (checkpoint)

openclaw-master-skills · files, path-sanitization, session-management, path-traversal-prevention, storage

Sanitizes a session ID and joins it with the checkpoint directory to produce a safe per-session path, preventing traversal.

// Source: https://github.com/LeoYeAI/openclaw-master-skills | License: MIT | Copyright 2026 MyClaw.ai (LeoYeAI)
// Provided via justclaw.it.com; keep this notice with the code.
  private getSessionDir(sessionId: string): string {
    const safeId = sessionId.replace(/[^a-zA-Z0-9_-]/g, "_");
    return path.join(this.config.checkpointDir, safeId);
  }

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key