O'Reilly logo
  • miraj Desai thinks this is interesting:

Generally speaking, you should never store a database table’s primary key value, such as $data['user_id'], in a cookie, because cookies can be manipulated easily. In this situation, it’s not going to be a problem as the user_id value isn’t actually used anywhere in the site (it’s being stored in the cookie for demonstration purposes).