Gayner Posted November 23, 2009 Share Posted November 23, 2009 Hey, im about to have users submit data into there own cookie but i need the text for the cookie to only allow xx certain amount of data in that cookie :-) how would i do that Link to comment https://forums.phpfreaks.com/topic/182578-can-i-use-_cookie/ Share on other sites More sharing options...
premiso Posted November 23, 2009 Share Posted November 23, 2009 You would have to do a check on the input string, if you only want a certain length use strlen. If that is not what you are after, please elaborate. Link to comment https://forums.phpfreaks.com/topic/182578-can-i-use-_cookie/#findComment-963660 Share on other sites More sharing options...
Gayner Posted November 23, 2009 Author Share Posted November 23, 2009 You would have to do a check on the input string, if you only want a certain length use strlen. If that is not what you are after, please elaborate. yea i know how to do that but how long char can cookie storE? Link to comment https://forums.phpfreaks.com/topic/182578-can-i-use-_cookie/#findComment-963668 Share on other sites More sharing options...
premiso Posted November 23, 2009 Share Posted November 23, 2009 yea i know how to do that but how long char can cookie storE? Well what are you planning on storing? As far as I know there is a 4kb limit on cookie lengths, a better alternative is storing the data in a database then having an access hash stored in the cookie and using that to pull the data out. Link to comment https://forums.phpfreaks.com/topic/182578-can-i-use-_cookie/#findComment-963676 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.