removeOldSessionCookie example

/** * Regenerates the session ID. * * @param bool $destroy Should old session data be destroyed? */
    public function regenerate(bool $destroy = false)
    {
        $_SESSION['__ci_last_regenerate'] = Time::now()->getTimestamp();
        session_regenerate_id($destroy);

        $this->removeOldSessionCookie();
    }

    private function removeOldSessionCookie(): void
    {
        $response              = Services::response();
        $cookieStoreInResponse = $response->getCookieStore();

        if ($cookieStoreInResponse->has($this->config->cookieName)) {
            return;
        }

        
Home | Imprint | This part of the site doesn't use cookies.