def add_value(cookie, name, value, lifespan, secure):
    """add a value to a cookie"""
    cookie[name] = value
    cookie[name]['httponly'] = True
    cookie[name]['path'] = '/'
    cookie[name]['expires'] = lifespan
    if secure:
        cookie[name]['secure'] = True
