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 Quote 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. Quote 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? Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/182578-can-i-use-_cookie/#findComment-963676 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.