Jump to content

Storing Data in sessions or cookies?


Monkuar

Recommended Posts

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?

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.