You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regenerates the current session ID. This should be called during state/privilege changes (e.g., post-login) to protect against session fixation attacks.
Usage
regenSession(bool $deleteOldSession = true): bool
Parameters
deleteOldSession (bool)
: Whether to delete the old associative session file/data. (default: true) ^(optional)^
Return Value
(bool)
: Returns true on success, or false if no active session exists.
Examples
// User completes login process
if ($userAuthenticated) {
$cphp->regenSession();
$cphp->setSession('logged_in', true);
}