def morsel_to_dict(morsel):
    """
    Compared to Python morsels flask lacks *comment* and *version* but has
    *samesite*.
    And the spelling of max-age differs.

    :param morsel:
    :return: dictionary
    """
    res = {}
    for attr in ['domain', 'path', 'expires', 'max-age', 'secure', 'httponly']:
        try:
            _v = morsel[attr]
        except KeyError:
            pass
        else:
            if attr == 'max-age':
                res['max_age'] = _v
            else:
                res[attr] = _v
    res['value'] = morsel.value
    return res