Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def persist_session(self):
"""
Save the session object to the session file.
"""
if self.config.get('persist_state'):
Utility.write_json(Utility.SESSION_FILE_PATH,
self.context['session'])
else:
Utility.delete(Utility.SESSION_FILE_PATH)