Hi,
I am getting mad with this setcookies(). My problem here is, sometimes this setcookies() just work as expected. But how come, it will seem like, can't create the cookies at client pc after a while? May I know what's the problem are?
Thanks in advance.
hi
first of all the syntax is setcookie(); when u need to create a cookie on a machine make it a habit of using Variables eg
$login = "loginname";
setcookie("nameofcookie",$login,time()+14400);
I hope this helps
Pradeep
I understand, what i more concern here is, whethere there is any limitation in creating cookie? because i have 12 variable, which store in cookie. But it seem like not functioning at all. why?
THanks Louis
The amount of data you can store in a cookie is limited. Check out the documentation.
If you need to store more data, create profiles and store them in a database. Use a value in a cookie to fetch the profile from the database when the user returns..
Storing data in a cookie is not good practice, you can't trust the client.
What you really need is sessions; it can handle all variables you want.
Where can i read more about the limitation of cookie?
I do use session before, but I dont' know what happend, the session doesn't work for 1 or couple day before. Now, i can store my variable in session perfectly. do you face the same problem before as mime?