CAS_Client::_renameSession PHP Method

_renameSession() private method

Renaming the session
private _renameSession ( string $ticket ) : void
$ticket string name of the ticket
return void
    private function _renameSession($ticket)
    {
        phpCAS::traceBegin();
        if ($this->getChangeSessionID()) {
            if (!empty($this->_user)) {
                $old_session = $_SESSION;
                phpCAS::trace("Killing session: " . session_id());
                session_destroy();
                // set up a new session, of name based on the ticket
                $session_id = preg_replace('/[^a-zA-Z0-9\\-]/', '', $ticket);
                phpCAS::trace("Starting session: " . $session_id);
                session_id($session_id);
                session_start();
                phpCAS::trace("Restoring old session vars");
                $_SESSION = $old_session;
            } else {
                phpCAS::trace('Session should only be renamed after successfull authentication');
            }
        } else {
            phpCAS::trace("Skipping session rename since phpCAS is not handling the session.");
        }
        phpCAS::traceEnd();
    }
CAS_Client