Unique user IDs

Results 1 to 3 of 3

Thread: Unique user IDs

  1. #1
    Join Date
    Dec 1969
    Posts
    730

    Default Unique user IDs

    Hi,<BR><BR>I need to give every user to my web site a unique ID. It is vital that it is unique. The way I figure it, I have three options:<BR><BR>1)User auto number field of a database. Guaranteed unique but slow.<BR><BR>2)Increment a number in a text file. Guaranteed unique but very slow.<BR><BR>3)Use the SessionID. Not guaranteed unique but quick.<BR><BR>3 Is obviously my favourite if only it was guranteed to be unique. What I thinking is could I use the session ID and another number on the end that is generated randomly? The chances of it every coming up with the same number have to be a trillion to one.<BR><BR>What do you think?<BR><BR>Thanks<BR>Andy

  2. #2
    Join Date
    Dec 1969
    Posts
    1,671

    Default RE: Unique user IDs

    Andy,<BR>I was up against the same thing. In my case I concatinated a value with SessionID<BR>I used:<BR> MyUserID=hour(now)& minute(now) & second(now)& session.SessionID<BR>Theoretically, it could happen twice but now the chances are much less like ....a trillion trillion to one :)<BR>(now I have asked for it from the scentists!)<BR>Also, if a key violation occurs, trap it and have the script try again. Since the value will change with time, it will probably go in on the second try.<BR><BR>Mike<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    730

    Default RE: Unique user IDs

    Use time. I like it.<BR><BR>Thanks very much.<BR>Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •