Casted frappe.db.get_system_setting('deny_multiple_sessions') to int, as a string it is always evaluated as True in the conditional statement and therefore it is always treated as multiple sessions are denied.