def set_message_cookie(url, msg):
    # We just keep the message two seconds.
    max_age = 2
    expires_time = time.time() + max_age
    expires = cookie_date(expires_time)

    response = HttpResponseRedirect(url)
    response.set_cookie("message", lfs_quote(msg), max_age=max_age, expires=expires)

    return response
Returns a HttpResponseRedirect object with passed url and set cookie
dataset/ETHPy150Open diefenbach/django-lfs/lfs/core/utils.py/set_message_cookie