pdo->prepare('SELECT 1 FROM nonces WHERE nonce = ? LIMIT 1'); $st->execute([$nonce]); return (bool)$st->fetchColumn(); } public function remember(string $nonce, int $expiresAt): void { $st = $this->pdo->prepare('INSERT INTO nonces (nonce, expires_at) VALUES (?, ?)'); $st->execute([$nonce, $expiresAt]); // Cron-less reap: Cafe24 has no scheduler, so expired nonces accumulate forever until // the table bloats and inserts slow/fail. Opportunistically prune a bounded batch of // already-expired rows (safe: seen() only cares about unexpired ones). if (mt_rand(1, 100) === 1) { $del = $this->pdo->prepare('DELETE FROM nonces WHERE expires_at < ? LIMIT 5000'); $del->execute([time()]); } } }