Added 'by_structure_name' scope for session model.