--- title: "system.util.getSessionInfo" description: "Returns a PyDataSet holding information about all of the sessions (logged-in users) on the Gateway." --- # system.util.getSessionInfo > Returns a PyDataSet holding information about all of the sessions (logged-in users) on the Gateway. This function is used in **Python Scripting**. ## Description Returns a PyDataSet holding information about all of the sessions (logged-in users) on the Gateway. Optional regular-expression based filters can be provided to filter the username or the username and the project returned. The PyDataSet returned has these columns: - username (String) - project (String) - address (String) - isDesigner (Boolean) - clientId (String) - creationTime (Date) Note that this function will not return all sessions across a cluster - only the cluster node that is being communicated with by the client who makes the call. :::tip This function accepts [keyword arguments](scripting\python-scripting\user-defined-functions.md#keyword-arguments) as of 7.9.9. ::: ## Client Permission Restrictions This scripting function has no [Client Permission](projects\project-properties\project-properties.md#client---permissions) restrictions. ## Syntax `system.util.getSessionInfo([usernameFilter] [, projectFilter])` ### Parameters |Type|Parameter|Description| |--|--|--| |String |`usernameFilter` | A regular-expression based filter string to restrict the list by username. [optional]| |String |`projectFilter` | A regular-expression based filter string to restrict the list by project [optional]| ### Returns **PyDataSet** - A dataset representing the Gateway's current sessions. ### Scope All ## Code Examples ```python title="Example #1" # This code would get the entire table of sessions and put it in an adjacent table table = event.source.parent.getComponent("Table") sessions = system.util.getSessionInfo() table.data = system.db.toDataSet(sessions) ``` ```python title="Example #2" # This code would count the number of times a user named "billy" is logged in sessions = system.util.getSessionInfo("billy") system.gui.messageBox("Billy has %d sessions" % len(sessions)) ``` ```python title="Example #3" # This code would return session info on all users starting with the letters "bi" sessions = system.util.getSessionInfo("bi.*") ``` ```python title="Example #4" # This code uses a single character wildcard in the username sessions = system.util.getSessionInfo("bi.ly") ``` ```python title="Example #5" # This code would return session info on a user named "bill.smith" sessions = system.util.getSessionInfo("bill\.smith") ```