def METHOD_NAME(request, response):
    if not request.session.get('auth_session_expiration_required'):
        return
    value = 'age'
    if settings.SESSION_EXPIRE_AT_BROWSER_CLOSE_FORCE or \
            not request.session.get('auto_login', False):
        value = 'close'
    age = request.session.get_expiry_age()
    response.set_cookie('jms_session_expire', value, max_age=age)
    request.session.pop('auth_session_expiration_required', None)