Session goes to none with 360Dialog API

I have the 360Dialog API, and the webhook is set up for my API, which is working normally. It receives messages and status notifications and responds with ‘OK 200’. I want to create a bot in my webhook handler that can automatically reply to inbound messages based on what the user has sent. To create a conversation flow, I need to be able to create a session for a specific user. However, when I try to create a session in my program, the session gets updated with each new message, and the session values from the previous request are lost. I would like assistance in understanding how to maintain a session for a specific user across multiple requests, or if there is another approach to configure the webhook for creating a user experience. If anyone can help me understand why my session goes to ‘none,’ it would be greatly appreciated.


from flask import Flask, request, make_response, session
import requests

app = Flask(__name__)
app.secret_key = 'ab11cxyz'

API = 'Lv7xLaYIAZAF1234567TestAPIV8AK'
app.config['PERMANENT_SESSION_LIFETIME'] = 1800


@app.route("/", methods=['POST'])
def message():
    # session.permanent = True
    notification = request.json

    if 'messages' in notification:
        current_menu = session.get('current_menu')
        print(current_menu, 'xyz')
        username = notification['contacts'][0]['profile']['name']
        wa_id = notification['contacts'][0]['wa_id']
        text = notification['messages'][0]['text']['body'].lower()

        if text in ['hi', 'hello', 'hey', 'salam', 'm']:
            session['current_menu'] = 'I am hi'
            current_menu = session.get('current_menu')

            body = {
                "recipient_type": "individual",
                "to": wa_id,
                "type": "text",
                "text": {
                    "body": 'Hi Received'
                }
            }
            URL = 'https://waba.360dialog.io/v1/messages'
            headers = {
                'Content-Type': 'application/json',
                'D360-API-KEY': API
            }
            # requests.post(url=URL, headers=headers, json=body)
            response = requests.post(url=URL, headers=headers, json=body)
            print(response.text)

            current_menu = session.get('current_menu')
            print(current_menu, '1234')
    return make_response()


if __name__ == '__main__':
    app.run(port=5000)