Jump to content

[SOLVED] Performance impact of cookies


SchweppesAle

Recommended Posts

Hi, I was just wondering what impact there would be in terms of performance if you where to set then increment the value of a cookie on each page of a site.   

 

Also, being a server side script; how exactly does php retrieve the value of a cookie? 

 

Does the server need to request then wait for the appropriate cookie before displaying any content? 

 

Wouldn't this be slower than querying a database?

Link to comment
https://forums.phpfreaks.com/topic/177855-solved-performance-impact-of-cookies/
Share on other sites

The cookie holds data on the client, and that data is included in the header of each request. If the script that the client requests can use the data in the cookie it will.

 

Session cookies work differently. The data of a session cookie is actually held on the server, and the client receives a special cookie that has a unique value, sort of like a key, that allows the data on the server to be used.

 

I don't believe there is a performance impact for simple cookie usage.

If you are going to do that, why don't you just do it by i.p. instead of cookie? Some wise guy might set there page count in their cookie to "53094839045" or even text.

 

Once the cookie's value reaches a certain number, it's reset to 0 and the user is redirected to another page.  They'd have no reason to do that :P

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.