---
title: Introduction
subtitle: Run continuous tasks and workflows with a long-lived browser session
slug: browser-sessions/introduction
---

## Why Browser Sessions?
Skyvern Browser Session is a way to persist the real-time state of the browser, so that any run can continue from where the previous run left off. Here are some scenarios when Skyvern Browser Session comes in handy:
- You have multiple continuous tasks that need to interact with the browser in real-time without much delay. For example, you are developing a phone agent for your customer support center and your agent needs access to real time information in the browser.
- You have several related tasks that may need to be executed but with interruptions in between. For example, you are developing an shopping agent that needs human in the loop to help fulfill the purchase.

Skyvern Browser Sessions is currently is only available via [API & SDK](/api-reference/api-reference/browser-session/create-browser-session).

## Create a Browser Session
- [API doc](/api-reference/api-reference/browser-session/create-browser-session)

```python
from skyvern import Skyvern

skyvern = Skyvern(api_key="YOUR_API_KEY")
browser_session = await skyvern.browser_sessions.create_browser_session(
	timeout=60,
)
```

- The `timeout` parameter (`>=5, <=10080`) is the max time in minutes that the browser session can run. By default, the timeout is 60 minutes.
- The `browser_session_id` the session ID you should note.

## Get A Browser Session
- [API doc](/api-reference/api-reference/browser-session/get-browser-session)

```python
from skyvern import Skyvern

skyvern = Skyvern(api_key="YOUR_API_KEY")
browser_session = await skyvern.browser_sessions.get_browser_session(
	browser_session_id="YOUR_BROWSER_SESSION_ID",
)
```

## Close A Browser Session
- [API doc](/api-reference/api-reference/browser-session/close-browser-session)

```python
from skyvern import Skyvern

skyvern = Skyvern(api_key="YOUR_API_KEY")
await skyvern.browser_sessions.close_browser_session(
	browser_session_id="YOUR_BROWSER_SESSION_ID",
)
```