--- title: "system.perspective.getSessionInfo" description: "Returns information about one or more Perspective Sessions." --- # system.perspective.getSessionInfo > Returns information about one or more Perspective Sessions. This function is used in **Python Scripting**. ## Description Returns information about one or more Perspective Sessions. The information returned by this function is a combination of information available on the [Perspective Sessions status](platform\gateway\status\connections\connections-perspective-sessions\connections-perspective-sessions.md#perspective-session-details) page on the Gateway, and some Session props (id and userAgent). Exact fields are as follows: | Key | Description | Value | | :--- | :--- | :--- | | userAgent | Details about the device or browser running the Session. | String | | id | The Session ID (or Designer ID if called from the Designer). | String | | username | The logged-in user's name or "Unauthenticated" if the Session is not authenticated. | String | | project | The name of the project active in the Session. | String | | uptime | The time (in milliseconds) the Session has been active since creation. | Integer | | clientAddress | The IP address or hostname of the client running the Session. | String | | lastComm | The time (in milliseconds) since the last communication with the Gateway. | Integer | | sessionScope | The environment where the Session is running: designerbrowseriosandroid | String | | activePages | The number of pages currently active in the Session. | Integer | | recentBytesSent | The number of bytes sent to the Gateway in the most recent communication. | Integer | | totalBytesSent | The total number of bytes sent to the Gateway by the Session. | Integer | | pageIds | A list of the IDs of pages currently open in the Session. | List | | authorized | Whether the user was authorized when the Session data was retrieved (**True** or **False**) | Boolean | ## Syntax :::tip This function accepts [keyword arguments](platform\scripting\python-scripting\user-defined-functions.md#keyword-arguments). ::: `system.perspective.getSessionInfo([usernameFilter], [projectFilter])` ### Parameters | Type | Parameter | Description| | ------- | ------- | ------ | | String | `usernameFilter` | A filter based on logged in user. [optional] | | String | `projectFilter` | A filter based on the project name. [optional] | ### Returns **List** - A list of objects ([PyJsonObjectAdapter](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.34/com/inductiveautomation/ignition/common/script/adapters/PyJsonObjectAdapter.html)). ### Scope Gateway, Perspective Session ## Code Examples ```python title="Code Snippet" # This code counts the number of times a user named "billy" is logged in. sessions = system.perspective.getSessionInfo("billy") print "Billy has %d sessions" % len(sessions) ``` ```python title="Code Snippet" # This script gets all sessions using the "MyProject" project and displays information about them. # Get the Session info. projectResults = system.perspective.getSessionInfo(projectFilter="MyProject") # Loop through the sessions. # Enumerate() gives both the Session object and the index. for index, sessionObj in enumerate(projectResults): # Print session info print "Session", index, ": username: ", sessionObj["username"], "uptime: ", sessionObj["uptime"], " seconds" ```