> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# login table

> This table contains entries for the user sessions.

## login Table (297)

This table contains entries for the user sessions.

## Fields

| Name                 | Description                                                                                                          | Type                                      | Nullable |
| -------------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | :------: |
| id                   | The primary key (auto-incremented)                                                                                   | PK                                        |    No    |
| user\_id             | The id of the user this entry references.                                                                            | FK [ejuser](./ejuser.mdx)                 |    No    |
| session\_key         | A random 32 characters value used as authentication key for the session.                                             | String(32)                                |    No    |
| remote\_addr         | The IP address of the client for this session.                                                                       | String(64)                                |    Yes   |
| remote\_host         | The hostname (depending on whether reverse lookup is enabled in httpd) or IP address of the client for this session. | String(64)                                |    Yes   |
| logged\_in           | When this session started.                                                                                           | DateTime                                  |    Yes   |
| idle                 | The last time this session was active.                                                                               | DateTime                                  |    Yes   |
| status               | The status (enum) for this session.                                                                                  | Int                                       |    No    |
| origin               | 1=soap call, 2=web pages                                                                                             | Int                                       |    No    |
| error\_message       | Stores the last error message recorded on this session                                                               | String(255)                               |    Yes   |
| authentication\_type | The authentication type (enum) for this session.                                                                     | authentication\_type                      |    Yes   |
| active\_menu         | The currently active (open) left-menu for this session.                                                              | Int                                       |    Yes   |
| ns\_secret           | Netserver login secret.                                                                                              | String(2000)                              |    Yes   |
| flags                | Bitmask of flags for a service login session                                                                         | Enum [LoginFlags](./enums/loginflags.mdx) |    Yes   |

<img src="https://mintcdn.com/superofficeas/6OcOTPa_ISkjXJg4/media/loc/en/database/tables/login.png?fit=max&auto=format&n=6OcOTPa_ISkjXJg4&q=85&s=6b9c798e2750b1178c5490f3402b19a1" alt="login table relationship diagram" width="904" height="811" data-path="media/loc/en/database/tables/login.png" />

## Indexes

| Fields       | Types      | Description |
| ------------ | ---------- | ----------- |
| user\_id     | FK         | Index       |
| session\_key | String(32) | Index       |
| status       | Int        | Index       |
| origin       | Int        | Index       |

## Relationships

| Table                                          | Description                                                                                                                                    |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [ejuser](./ejuser)                             | This table contains entries for the users of the system.                                                                                       |
| [extra\_tables\_result](./extra-tables-result) | Result set of executed search in ejournal extra tables                                                                                         |
| [invoice\_sum](./invoice-sum)                  | This table is used temporarily when listing invoice statistics. It is used because we need to sort balances from both customers and companies. |
| [session\_object](./session-object)            | Generic session object, accessible from ejscript etc, typically xml or name=value syntax, may be stored over several rows if big               |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

- [Create Session](/en/api/reference/restful/agent/customerservice_agent/create-session.md)
- [login_customer table](/en/database/tables/login-customer.md)
- [extra_tables_result table](/en/database/tables/extra-tables-result.md)
- [Protected tables](/en/api/bulk-operations/mass-operations/protected-tables.md)
- [Enum values for LoginFlags](/en/database/tables/enums/loginflags.md)
- [session_object table](/en/database/tables/session-object.md)
