def increment_counter(session_attributes, counter):
    """
    Increment counter value in session attribute.
    :param session_attributes: Session attributes
    :param counter: Key in session attribute
    :return: Updated count
    """
    counter_value = session_attributes.get(counter, '0')

    if counter_value:
        count = int(counter_value) + 1
    else:
        count = 1

    session_attributes[counter] = count

    return count