## PolkitBackendSessionMonitor PolkitBackendSessionMonitor — Monitor sessions |

## Synopsis

                        PolkitBackendSessionMonitor;
    PolkitBackendSessionMonitor * polkit_backend_session_monitor_new
                                                            (void);
    GList *             polkit_backend_session_monitor_get_sessions
                                                            (PolkitBackendSessionMonitor *monitor);
    PolkitIdentity *    polkit_backend_session_monitor_get_user_for_subject
                                                            (PolkitBackendSessionMonitor *monitor,
                                                             PolkitSubject *subject,
                                                             GError **error);
    PolkitSubject *     polkit_backend_session_monitor_get_session_for_subject
                                                            (PolkitBackendSessionMonitor *monitor,
                                                             PolkitSubject *subject,
                                                             GError **error);
    gboolean            polkit_backend_session_monitor_is_session_local
                                                            (PolkitBackendSessionMonitor *monitor,
                                                             PolkitSubject *session);
    gboolean            polkit_backend_session_monitor_is_session_active
                                                            (PolkitBackendSessionMonitor *monitor,
                                                             PolkitSubject *session);

## Object Hierarchy

      GObject
       +----PolkitBackendSessionMonitor

## Signals

      "changed"                                        : Run Last

## Description

The PolkitBackendSessionMonitor class is a utility class to track and monitor sessions.

## Details

### PolkitBackendSessionMonitor

    typedef struct _PolkitBackendSessionMonitor PolkitBackendSessionMonitor;

### polkit_backend_session_monitor_new ()

    PolkitBackendSessionMonitor * polkit_backend_session_monitor_new
                                                            (void);

### polkit_backend_session_monitor_get_sessions ()

    GList *             polkit_backend_session_monitor_get_sessions
                                                            (PolkitBackendSessionMonitor *monitor);

### polkit_backend_session_monitor_get_user_for_subject ()

    PolkitIdentity *    polkit_backend_session_monitor_get_user_for_subject
                                                            (PolkitBackendSessionMonitor *monitor,
                                                             PolkitSubject *subject,
                                                             GError **error);

### polkit_backend_session_monitor_get_session_for_subject ()

    PolkitSubject *     polkit_backend_session_monitor_get_session_for_subject
                                                            (PolkitBackendSessionMonitor *monitor,
                                                             PolkitSubject *subject,
                                                             GError **error);

Gets the session corresponding to `subject` or `NULL` if no session exists.

`monitor` : | A PolkitBackendSessionMonitor.
`subject` : | A PolkitSubject.
`error` : | Return location for error.
Returns : | `NULL` if `error` is set otherwise a PolkitUnixSession that should be freed with `g_object_unref()`.

### polkit_backend_session_monitor_is_session_local ()

    gboolean            polkit_backend_session_monitor_is_session_local
                                                            (PolkitBackendSessionMonitor *monitor,
                                                             PolkitSubject *session);

### polkit_backend_session_monitor_is_session_active ()

    gboolean            polkit_backend_session_monitor_is_session_active
                                                            (PolkitBackendSessionMonitor *monitor,
                                                             PolkitSubject *session);

## Signal Details

### The `"changed"` signal

    void                user_function                      (PolkitBackendSessionMonitor *monitor,
                                                            gpointer                     user_data)      : Run Last

Emitted when something changes.

`monitor` : | A PolkitBackendSessionMonitor
`user_data` : | user data set when the signal handler was connected.