You store the users details in a database along with a unique key.
You only store the unique key in the cookie.
The unique key could consist of a timestamp and a single piece of personal information along with perhaps a salt all of which is then encrypted.
This search creating secure cookies should give you some more reading to do on this.
You could require them to be https cookies too.
Beware that incoming cookies could well have been tampered with, so make sure the ensuing SQL query (to retrieve details) is escaped correctly to avoid an SQL injection attack.