def format_session_subjects(request):
    """Create a string listing session subjects for this connection, suitable for
    appending to authentication error messages."""
    decorated_subject_list = [request.primary_subject_str + " (primary)"]
    for subject in request.all_subjects_set:
        if subject != request.primary_subject_str:
            decorated_subject_list.append(subject)
    return ", ".join(decorated_subject_list)