Facebook Messenger Bot: Session Variables

I use PHP to write a bot. I save the selected items in a session variable in my file webhooks. The fact is that at the next request for hooks, it does not display session data and returns empty.

+4
source share
1 answer

Facebook does not close the session with your website. You should think of it as a “session per request”. In other words, you need to implement a simple structure in memory for storing data about conversations - it is recommended to store the key value using the sender ID as the key. You can also use redis for this task.

+6
source

All Articles