Forum OpenACS Q&A: Response to Codified URLs

Collapse
3: Response to Codified URLs (response to 1)
Posted by Jonathan Ellis on
Why bother with "random" at all?  If the link is to a page that doesn't require a login (if it did, just put a hook in the page to write that to your db) but you are emailing registered users, use their userid as the "key" in the url you send out.  It's already globably unique so you don't have to do any extra work...

If for some reason you're sending mail to nonregistered users whose email address you somehow acquired (legitimately, right? :) then make a new key (still no need for random numbers, just start with 1) and write an email/key pairing to a table created for that purpose.