Summary of session connection properties and options

Connection properties
  • SessionID  
    SELECT CONNECTION_PROPERTY('SessionID') INTO ses_id;

    Provides the current session ID within the current database context.

  • SessionCreateTime  
    SELECT CONNECTION_PROPERTY('SessionCreateTime') INTO ses_create;

    Provides the timestamp of when the session was created.

  • SessionLastTime  
    SELECT CONNECTION_PROPERTY('SessionLastTime') INTO ses_last;

    Provides timestamp of when the session was released by the last request.

  • http_session_timeout  
    SELECT CONNECTION_PROPERTY('http_session_timeout') INTO ses_timeout;

    Fetches the current session timeout in units of minutes.

HTTP options
  • 'SessionID','value'  
    CALL sa_set_http_option( 'SessionID', 'my_app_session_1' );

    Create or change a session context for the current HTTP request. Returns an error if my_app_session_1 is owned by another HTTP request.

  • 'SessionID', NULL  
    CALL sa_set_http_option('SessionID', NULL );

    If the request comes from the session creator, the current session is deleted immediately; otherwise, the session is marked for deletion. Deleting a session when the request has no session is not an error and has no effect.

    Changing a session to a SessionID of the current session (has no pending session) is not an error and has no substantial effect.

    Changing a session to a SessionID in use by another HTTP request is an error.

    Changing a session when a change is already pending results in the pending session being deleted and new pending session being created.

    Changing a session with a pending session back to its original SessionID results in the pending session being deleted.

HTTP session timeout
  • http_session_timeout  
    SET TEMPORARY OPTION PUBLIC.http_session_timeout=100;

    Sets the current HTTP session timeout (in minutes). The default is 30 and the range is 1 to 525600 minutes (365 days).

    See http_session_timeout option [database].