0
votes

I am creating a web server that is using Twilio to send / receive messages.

The problem that I am facing is that Twilio uses sender and receiver phone number as a key for a cookie. But in my case, user can have multiple conversations with a server.

As I can think of the solution, the only was would be that I pass all the time cookie that will say which conversatation_id that conversation belongs to.

But since the cookie expiration time is 4h, what would happen if the first sms that I send has cookie conversation_id attached, and the person who received sms replies after 4h. Would I still get conversation_id cookie attached to the message?

Can someone suggest better way of solving this problem?

1

1 Answers

1
votes

Twilio developer evangelist.

There is no way to conduct multiple different conversations between two numbers by SMS message. You can confirm this for yourself by trying to respond to a particular message in a timeline of SMS messages in your phones SMS app. It's simply not possible.

If you do want to maintain multiple different conversations with a user between your application and their phone, then the best bet is to use different Twilio numbers to conduct different conversations. This is best explained in this article on how to use a number pool to conduct multiple conversations on the Twilio site