scistag.remotestag.session.Session

class Session(config)[source]

Bases: object

Represents a single user data session

Initializer

Parameters

config (dict) – The configuration dictionary. Has to at least contain the sessionId

Methods

get_guest_data

Returns the last guest data

handle_load

Is called right after the constructor and before the build call

handle_unload

Called when the session shall deallocate memory intensive resources

handle_used

Should be called when the session was requested

handle_user_data

Requests if the user data shall be handled manually.

set_guest_data

Backups the last data for a guest viewer

set_user_data

Stores user data provided from the browser

update_config

Returns the current configuration :rtype: dict :return: The configuration

Attributes

PERMISSIONS

REMOTE_SESSION

SESSION_ID

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

lock

Multithread access lock

unloaded

Set to true when the app is going to be destroyed and should not be used anymore

session_id

The unique session identifier

guest_id

Access id for guest access

guest_data

Contains the previous image cached for a guest viewer

_config

The configuration dictionary

last_interaction

Last interaction to manage garbage collection in seconds

session_timeout

The session timeout in seconds.

user_data_config

registered user data elements

data_connection

Local database connection

get_guest_data()[source]

Returns the last guest data

Return type

bytes | None

Returns

The last guest data

handle_load()[source]

Is called right after the constructor and before the build call

Returns

handle_unload()[source]

Called when the session shall deallocate memory intensive resources

handle_used()[source]

Should be called when the session was requested

Return type

None

handle_user_data(user_data_name, data)[source]

Requests if the user data shall be handled manually.

Otherwise it ‘s stored in {rootPath}.userData

Parameters
  • user_data_name (str) – The data ‘s identifier

  • data (bytes) – The data to be set

Returns

True if the data shall not be stored in the vault

set_guest_data(data)[source]

Backups the last data for a guest viewer

Parameters

data (bytes) – The last image

set_user_data(user_data_name, data)[source]

Stores user data provided from the browser

Parameters
  • user_data_name (str) – The user data’s name (alpha numeric)

  • data (bytes) – The data

Return type

None

update_config()[source]

Returns the current configuration :rtype: dict :return: The configuration

_config

The configuration dictionary

data_connection

Local database connection

guest_data: bytes | None

Contains the previous image cached for a guest viewer

guest_id

Access id for guest access

last_interaction

Last interaction to manage garbage collection in seconds

lock

Multithread access lock

session_id

The unique session identifier

session_timeout

The session timeout in seconds. 0.0 = no timeout

unloaded

Set to true when the app is going to be destroyed and should not be used anymore

user_data_config

registered user data elements