Jump to content

Recommended Posts

I have a script that processes every 3 seconds via AJAX from a users browser

 

This script writes new information to a cookie/session

 

Can anyone see this being a problem

 

Also, which is more effecient, a cookie or a session

 

With a session that is going to require server disk access in regards to re-writing the session data and storing it on the server

 

Cookie would be locally on the users machine

 

Feedback would be great

Link to comment
https://forums.phpfreaks.com/topic/75338-update-cookiesession/
Share on other sites

Don't use cookies, there is no guarantee that the user has not modified them, let alone allowed them to be utilised.

I imagine they're just as efficient as each other. As for disk access; it would be at both ends. SESSION on the server and cookies on the local machine, however the overhead from writing a SESSION would be negligble to be honest unless you're planning on writing MBs worth of information. Alternatively you could utilised a database to store the information instead of a session, but relate it to session_id and to the lookup. Either way it's disk access, although there is a good chance that your database system will have cached the query in memory for use in subsequent requests.

Link to comment
https://forums.phpfreaks.com/topic/75338-update-cookiesession/#findComment-381011
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.