I've created a log in script that checks details against a database. If the login is successful then it sets a cookie on the machine to allow it to log in automatically in the future. My trouble is, somehow giving it some form of encryption, as at the moment, the cookie value is fairly basic (1,2,3..etc, basically the user id in the database). Someone suggested to me to just pick two numbers and create my own formula to make it harder to crack ,but is there a more secure way of doing it? Is there a built in PHP function to do it?
Any help appreciated.