> ## Documentation Index
> Fetch the complete documentation index at: https://tbd-6fc993ce-mintlify-add-deploy-button-docs-27400.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Termination & Timeouts

Kernel browsers should be terminated after you're done with them.

<Info>
  Using Playwright/Puppeteer's method `browser.close()` does not delete the browser. Use one of the methods below to delete the browser.
</Info>

## Deleting a browser via session ID

Every browser instance has a `session_id`. You can delete any browser using its session ID:

<CodeGroup>
  ```typescript Typescript/Javascript theme={null}
  import Kernel from '@onkernel/sdk';

  const kernel = new Kernel();

  await kernel.browsers.deleteByID('htzv5orfit78e1m2biiifpbv');
  ```

  ```python Python theme={null}
  from kernel import Kernel

  kernel = Kernel()
  kernel.browsers.delete_by_id("htzv5orfit78e1m2biiifpbv")
  ```
</CodeGroup>

## Automatic deletion via timeout

If you don't manually delete a browser, it will be automatically deleted after a configurable `timeout` (default 60 seconds). The timeout begins when the browser does not see a CDP or live view connection.

You can set a custom timeout of up to 72 hours when creating a browser:

<CodeGroup>
  ```typescript Typescript/Javascript theme={null}
  import Kernel from '@onkernel/sdk';

  const kernel = new Kernel();

  const browser = await kernel.browsers.create({ timeout_seconds: 300 });
  console.log(browser.session_id);
  ```

  ```python Python theme={null}
  from kernel import Kernel

  kernel = Kernel()

  browser = kernel.browsers.create(timeout_seconds=300)
  print(browser.session_id)
  ```
</CodeGroup>
