public function start()
{
if ($this->request === null) {
$requestHandler = $this->bootstrap->getActiveRequestHandler();
if (!$requestHandler instanceof HttpRequestHandlerInterface) {
throw new Exception\InvalidRequestHandlerException('Could not start a session because the currently active request handler (%s) is not an HTTP Request Handler.', 1364367520);
}
$this->initializeHttpAndCookie($requestHandler);
}
if ($this->started === false) {
$this->sessionIdentifier = Algorithms::generateRandomString(32);
$this->storageIdentifier = Algorithms::generateUUID();
$this->sessionCookie = new Http\Cookie($this->sessionCookieName, $this->sessionIdentifier, 0, $this->sessionCookieLifetime, $this->sessionCookieDomain, $this->sessionCookiePath, $this->sessionCookieSecure, $this->sessionCookieHttpOnly);
$this->response->setCookie($this->sessionCookie);
$this->lastActivityTimestamp = $this->now;
$this->started = true;
$this->writeSessionMetaDataCacheEntry();
}
}