// session_start();
$this->
setCookie();
} /**
* Takes care of setting the cookie on the client side.
* Extracted for testing reasons.
*/
protected function setCookie() { $expiration =
$this->config->expiration === 0 ? 0 : Time::
now()->
getTimestamp() +
$this->config->expiration;
$this->cookie =
$this->cookie->
withValue(session_id())->
withExpires($expiration);
$this->cookies
[] =
$this->cookie;
} public function regenerate(bool
$destroy = false
) { $this->didRegenerate = true;
$_SESSION['__ci_last_regenerate'
] = Time::
now()->
getTimestamp();
}}