WEBSOCKET and PHP data storage

0

I've come across a doubt, I have a WebSockets server written in PHP and I need to store information that the user sends to the server, and that this data can be retrieved only by the current session between the user and server.

I thought of SESSIONS but I do not think it's a good choice, what's the solution?

    
asked by anonymous 12.03.2015 / 18:22

1 answer

1

Depending on the amount of information, using sessions may not be the best idea. If you want an alternative, you can save to the database, based on the id of the current session ( session_id ) or a single number saved in $_SESSION , such as $user_id + time() .

id | id_sessao | info1 | info2 | ...
 1 |    234234 |   ... |   ... | ...
 2 |    345354 |   ... |   ... | ...
    
12.03.2015 / 19:55