Php setcookie in registration
Okay sorry for the stupid questi开发者_Go百科on im a begginer, and i would like the opinion from a more experienced developer.
I am makin a really small real estate website.
the signup asks for the first, last name, the phone and email.
they can login with their email and password.
My question is it a good idea to save the last, first name, and phone in cookies at the registration and save the email in to a cookie when they log in?
And could please someone explain if not why?
thank you
cookies are saved on the clients machine and can be manipulated, i would only save a session id in one, and store the 'hard' data in a db.
It is better to use $_SESSION variables. Read this for more information: http://php.net/manual/en/ref.session.php
精彩评论