-
Notifications
You must be signed in to change notification settings - Fork 0
setSession
Corey Avis edited this page Sep 23, 2026
·
2 revisions
Sanitizes the key and value through internal sanitization methods before persisting the data into $_SESSION.
setSession(string $key, mixed $value): bool
key (string) : The key under which the data will be stored.
value (mixed) : The data value to store (string, array, boolean, etc.).
(bool)
: Returns true, always.
$cphp->setSession('user_id', 42);
$cphp->setSession('profile', ['username' => 'name', 'role' => 'admin']);
- No debug errors.
clearSession | endSession | getSession | regenSession | removeSession | startSession