Jump to content

update cookie/session


jaymc

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.