# client.Client.session

- **Module:** client
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/client.ts#L49
- **Page:** https://libtmux.org/en/ts/latest/reference/client-client-session/

```
session(): Session | undefined
```

The session this client is attached to, if it is still attached.

## Examples

```ts
client.session?.name;
```

## In other ports

The session a client is attached to

| Language | Equivalent |
| --- | --- |
| Python | client_session is a session name, not a Session object |
| Ruby | [`LibTmux::ClientSnapshot#session`](/en/ruby/latest/reference/libtmux-clientsnapshot-session/) (method) |
| Lua | [`libtmux.SnapshotClient.session`](/en/lua/latest/reference/libtmux-snapshotclient-session/) (attribute) |
| Rust | [`client.Client.attached_session`](/en/rs/latest/reference/client-client-attached_session/) (method) |
| Go | [`tmux.Client.AttachedSession`](/en/go/latest/reference/tmux-client-attachedsession/) (method) |
| Java | [`io.github.libtmux.Client.session`](/en/java/latest/reference/io-github-libtmux-client-client-session/) (method) |
| Kotlin | [`io.github.libtmux.kotlin.Client.session`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-client-session/) (property) |
| Scala | [`io.github.libtmux.scaladsl.Client.session`](/en/scala/latest/reference/io-github-libtmux-scaladsl-client-session/) (method) |
| C# | [`LibTmux.Client.GetAttachedSessionAsync`](/en/csharp/latest/reference/libtmux-client-getattachedsessionasync/) (method) |
| C++ | [`libtmux::Client::session`](/en/cxx/latest/reference/libtmux-client-session/) (method) |
| Swift | the relationship is resolved through Snapshot.session(of:) |

No equivalent is recorded in PowerShell, Julia, Elixir or F#.
