Beispiel #1
0
	/**
	 * Regenerates the session ID.
	 * @throws InvalidStateException
	 * @return void
	 */
	public function regenerateId()
	{
		if (self::$started && !$this->regenerated) {
			if (headers_sent($file, $line)) {
				throw new InvalidStateException("Cannot regenerate session ID after HTTP headers have been sent" . ($file ? " (output started at $file:$line)." : "."));
			}
			session_regenerate_id(TRUE);
			session_write_close();
			$backup = $_SESSION;
			session_start();
			$_SESSION = $backup;
			$this->response->removeDuplicateCookies();
		}
		$this->regenerated = TRUE;
	}