Support Center
Renews current session, returning its new expiration time on output (in UTC).
Note that the call will raise an exception if:
renew(self, cid, current_ust, current_app, remote_addr, user_agent=None)
cid
: Correlation ID used by audit logcurrent_ust
: Current user's UST, the one to renewcurrent_app
: Name of application the current user is issuing the call fromremote_addr
: Current user's remote addressuser_agent
: User agent stringReturns
: expiration_time - A datetime object representing the session's new expiration time# -*- coding: utf-8 -*-
# Zato
from zato.server.service import Service
class RenewSession(Service):
def handle(self):
username = 'admin1'
password = 'abxqDJpXMVXYEO8NOGx9nVZvv4xSew9-'
current_app = 'CRM'
remote_addr = '127.0.0.1'
user_agent = 'Firefox 139.0'
# Log current user
session = self.sso.user.login(username, password, current_app, remote_addr, user_agent)
# Renew the session
expiration = self.sso.user.session.renew(self.cid, session.ust, current_app, remote_addr)
# Log result (in UTC)
self.logger.info('Expiration`: %s, %s', expiration, type(expiration))