posted 15 years ago
You can encode the user ID (and whatever other info you need) and associate the encoded number/characters with the user. For example, generate a simple hashCode (or something more sophisticated) from the user ID, and store both pieces of info in your db. Send the link to user with that encoded info as a URL parameter. When the user clicks on it, you can get the encoded URL parameter and retrieve the user ID from the database.
I think that's what most real life systems do.