Hi guys, For security purposes, I need to know if a user can create a cookie. Could the user fake something like this script on their computer? <?php setcookie('isadminastrator',true,time()+60*60*24*30*12'/','mysite.com',false,false); ?> Thanks, -Tony
yes. very easy. you need to make it harder like encrypt the content and store things also in the database.
Yes, something like that could easily be faked. You never grant permissions in a cookie. You create a unique Session ID and store that ID in the browser cookie with a corresponding entry in your Session file or database on the server to identify the user. Then you grant access to resources on your end based on what the user is allowed access to.