# Roaming Sessions in WND Terminal in a Browser | WND Software Docs

Source: https://wndsoftware.com/docs/roaming

### Roaming sessions

Your sessions belong to you, not to the browser window. Close the laptop and carry on from the tablet.

Sessions in WND Terminal in a browser run on your organization’s gateway. When a window closes they keep running for 8 hours, and Your open sessions  lists them on any device you sign in on. Attach  brings one into the window as it was, still logged on. A session is open in one window at a time, and nobody else sees it.

In WND Terminal in a browser, your sessions belong to you, not to the browser window. Close the laptop and carry on from the tablet.

Your sessions run on your organization’s gateway. When you close the window, or the laptop goes to sleep, they keep running there. Sign in on another device and Your open sessions  is at the top of the page:


```text
Your open sessions
  Test TSO        127.0.0.1:23   Open on Chrome on Windows, used 5 minutes ago     Attach   End
  Payroll (IBM i) ibmi.bank:23   Left running on Safari on iPad, closes in 7 hours  Attach   End
```

- Attach  brings the session into this window as it was, with the same screen, at the same place in the application, still logged on. Nothing is sent to the host.
- End  closes the session, wherever it is open.

The installed app on a phone or tablet shows the same list first.


### One device at a time

A session is open in one window at a time. Attaching it on the iPad takes it from the laptop. The laptop’s tab then says Continued on Safari on iPad , with Bring it back here  and Close tab . Only the window that has the session can type in it.

Devices are named by their browser and system, such as Chrome on Windows, Safari on iPad or Chrome on Android phone.


### Leaving a session running

Closing a tab asks whether to disconnect. In a browser it also offers Leave it running . The tab closes, and the session waits in Your open sessions for you to attach it on any device.

A session nobody has open keeps running for 8 hours (IT can change that), then closes. You can leave up to 8 sessions running at once. Leave a ninth, and the one left longest closes.

The host has its own timeouts. TSO logs a session off after it has had no input for a while, and so do CICS and IBM i. A session left running past them is still there, at the host’s logon or sign-on screen.


### Signing out

Sign out  closes the sessions open in that browser. Sessions you left on another device keep running until they close or you end them.

Being signed out because WND Terminal wasn’t used for a while (the idle timeout) doesn’t close your sessions. They keep running for the same 8 hours. Sign in again to continue them.

Another person never sees your sessions, in the list or anywhere else.


### For IT

Roaming is on by default. In the gateway’s configuration (`gateway.toml`):


```text
[roaming]
enabled = true
keep_minutes = 480
max_sessions_per_person = 8
```

On a small screen, swipe the table to read all columns.


| Setting | Default | What it does |
| --- | --- | --- |
| `enabled` | `true` | Sessions belong to the person. `false`: each browser window has its own sessions, which close when it closes (after `reconnect_grace_seconds` for a dropped connection). |
| `keep_minutes` | `480` | How long a session nobody has open keeps running (1 to 10080). |
| `max_sessions_per_person` | `8` | The most sessions one person can leave running with no window open. |

Sessions left running still count toward `[limits] max_sessions_per_user` and `max_sessions`, and toward the license’s seats like any other.

A dropped connection (Wi-Fi changing) still comes back by itself within `reconnect_grace_seconds` (60), with no list and no attaching. With more than one gateway behind a load balancer, keep the sticky sessions. A person’s sessions are on the gateway they signed in to.


#### The audit log

On a small screen, swipe the table to read all columns.


| Event | When |
| --- | --- |
| `session.attach` | A session continued on a device. With the device (`device`) and its address (`client_address`). |
| `session.taken` | The window that had the session was told it continued elsewhere. With that window’s device, and the device that took it (`by`). |
| `session.detach` | Nobody has the session open any more. It was left running, its window closed, or the sign-in timed out. With `keep_minutes`. |
| `session.expired` | A session left running closed, because nobody continued it in time or more than `max_sessions_per_person` were left. |

Each has the session’s name, host and port, and the person, like every session event. `session.connect` and `session.disconnect` are as before.


### The protocol

The browser and the gateway talk over one WebSocket. Roaming adds four calls and one event, and changes nothing that was there.

On a small screen, swipe the table to read all columns.


| Message | What it does |
| --- | --- |
| `sessions.list` | The person’s sessions: `id`, `name`, `host`, `port`, `opened_at`, `last_activity`, `state` (`here`, `elsewhere`, `away`, `left`), `attached_by` (a device), `closes_at`, `badges` (`shared` while the help desk views it). |
| `session.attach` `{id}` | Continue the session in this window. Answers with its screen. |
| `session.detach` `{id}` | Leave it running. |
| `session.end` `{id}` | Close it. |
| event `session.taken` `{id, by, ended}` | To the window that had a session another device attached (or ended). |

`hello` also says which device this is (`device`) and whether sessions roam (`roaming`).


### Related

[WND Terminal in a browser The self-hosted gateway with single sign-on. Read →](https://wndsoftware.com/browser)
[The help desk joining a session With the person’s consent, masked and recorded. Read →](https://wndsoftware.com/docs/help-desk)
[Phones and tablets The touch layout and key bar. Read →](https://wndsoftware.com/docs/mobile)

### Questions


#### Does attaching a session send anything to the host?

No. The session comes into the window with the same screen, at the same place in the application. Nothing is sent to the host.


#### How long does a session left running last?

8 hours by default. IT can set keep_minutes from 1 to 10080. The host’s own timeouts still apply, so TSO, CICS or IBM i may log the session off first.


#### Can someone else attach my session?

No. Another person never sees your sessions, in the list or anywhere else.

Technical reviewer: [Albert Joseph](https://wndsoftware.com/authors/albert-joseph), WND Software.
