Monkuar Posted August 15, 2012 Share Posted August 15, 2012 For my RPG game. I have a chatbox that is a notification box and a actual live chat (using only short polling) for now. I was wondering what's the best way to store client side information to display to the user? Like if a user kills a monster It will put "Gained 200 EXP". /etc/etc, Would using cookies for this be a good idea or...? would need to save that data for atleast a day, or 15+hours. I do not want to use mysql for this, there has to be a way storing it clientside? Quote Link to comment https://forums.phpfreaks.com/topic/267139-storing-data-in-sessions-or-cookies/ Share on other sites More sharing options...
xyph Posted August 15, 2012 Share Posted August 15, 2012 The problem with storing it in a cookie is that it's going to be sent to the server with every request - waste of bandwidth. This is what databases are designed to do, so I'm not sure why you're against going that way. Quote Link to comment https://forums.phpfreaks.com/topic/267139-storing-data-in-sessions-or-cookies/#findComment-1369698 Share on other sites More sharing options...
Monkuar Posted August 15, 2012 Author Share Posted August 15, 2012 The problem with storing it in a cookie is that it's going to be sent to the server with every request - waste of bandwidth. This is what databases are designed to do, so I'm not sure why you're against going that way. I just figured maybe the logs will take a performance hit.. I guess it just depends how bad I optimize them then eh? Like, if I am farming some mobs, and each time I kill 1 or take a hit, I want it to show "Took damage of "XXX", "You killed merman/etc gained 200XP". Maybe I am thinking little notifications to the user are fine for that instead of actually storing it? Maybe I am getting it a little mixed up, I apologize. I guess making a logs table will be a good idea, I can always just prune old ones after xx amount of time, or let the user delete his logs (that ARE NOT ESSENTIAL) if he/she wants. I think I might have been thinking a little bit to much and over-thought this process, I need to relax and let go. Quote Link to comment https://forums.phpfreaks.com/topic/267139-storing-data-in-sessions-or-cookies/#findComment-1369702 Share on other sites More sharing options...
Mahngiel Posted August 15, 2012 Share Posted August 15, 2012 I guess making a logs table will be a good idea, I can always just prune old ones after xx amount of time if the data is THAT insignificant, you could always create a flatfile Quote Link to comment https://forums.phpfreaks.com/topic/267139-storing-data-in-sessions-or-cookies/#findComment-1369714 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.