Can we Store the chat done on socket

so my doubt is, can we store the chat done on socket so that every new login person can see all the previous chat there is any method to do this

yes, in that case you would need to create sockets between client and server. whenever client 1 needs to send message to client 2, client 1 will send message to client using sockets, server will store a copy of message in db, and emit it to socket registered for client 2. When a new client joins, the new client will have to request for old messages from the server to be displayed, after which a socket will be formed for furthur realtime communication.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.