Reputation: 95910
I have written a small chat app that uses mysql + php to facilitate 1:1 chatting between users. I was wondering if it would be advisable to use only PHP sessions (using session injection) for chatting and only using mysql to find the session id of the users.
Will it be more efficient? Am i missing something out here?
Thank you for your time.
Upvotes: 1
Views: 224
Reputation: 75734
The SESSION
is a container for the data of a browser session, so I wouldn't abuse it for that. Better set up a database (even if it's sqlite in memory) and write the data into that.
Upvotes: 2
Reputation: 2218
By default the session is stored in file and is not intended to store shared data. Better will be to store that in file by yourself - CSV, serialized values or something like that. Or best will be to store the data in the memcached (stored values to RAM) if you have the option and you are expecting to have huge number of visitors.
Upvotes: 2