Jump to content

Maximum cookie size?


dominod

Recommended Posts

Hi

 

I know that maximum size of one cookie is 4Kb.. That is kilobytes right? and not kilobit?

 

And a byte is 8 bits right?

 

So if I have "Hello" in my cookie thats 5 characters which means the cookie is 5 x 8 = 40 bit which is again 5 bytes (?). Does this mean that I can have a maximum of 4000 characters in my cookie? Or did I miss something here?

 

Thanks :)

Link to comment
https://forums.phpfreaks.com/topic/211431-maximum-cookie-size/
Share on other sites

dont use sessions, a cookie is a high enough level interface.

 

 

but if you want to store variables in the cookie, i recomend, storing the variables server side, and the cookie can be a hash, or an id, to a row in a table, and read them off there....

 

this also allows data to be ip checked - stop cookie theives, 'cept for the ones in the same house.

Link to comment
https://forums.phpfreaks.com/topic/211431-maximum-cookie-size/#findComment-1102423
Share on other sites

dont use sessions, a cookie is a high enough level interface.

 

Why would you not want to use sessions? Just curious as to your logic behind that statement.

 

i recomend, storing the variables server side

 

You do realize that is what session data does...stores information on the server right?

Link to comment
https://forums.phpfreaks.com/topic/211431-maximum-cookie-size/#findComment-1102425
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.