This question is quite general in the sense that it applies to any language, but still specific to the following situation:
Consider the website isidewith.com.
Now imagine, all previous answers determine the next question asked.
This means for each user, the server needs to keep calculating this users previous "answer data" to determine what question to return next. i.e- this means storing answer to 1st, 2nd and 3rd question to determine 4th question.
I was thinking the best approach was to create a session ID. Then store this data in a database identifiable by the session id. Then after a given timeout, the session ends and the data for that given session id is deleted from the database.
Is this the best approach, and if so, what's the best way to implement timeout etc. I was also thinking of just storing the data in memory - dictionaries with lists identifiable by session IDs.
I'm not sure if SO will accept such a general question, but I really have no idea how to best approach this and Google is of no help.
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire