This is pretty much what happens when someone enters the link:
try:
user_id, session_id = [int(val) for val in Fernet.decrypt((request.query.get('reference')).encode()).decode().split('/')]
except Exception as exception:
logging.error(exception)
traceback.print_exception(exception)
return web.Response(status=500, body=f'Something went wrong while reading the reference...')