Hi,

I am intending log user actions in a module I'm developing, and am considering logging the user's uid as an identifier for the user in question. However, I am concerned about the possibility of the following scenario : if user A has uid 1, and at some point user A was deleted, is it possible for another user say B to have a uid 1 later on (and thus result in ambiguity)?

Thanks in advance.

Comments

lyricnz’s picture

(IIRC) Nope, unless you fiddle with the DB, there's an incrementing number in some counter table.

beautifulmind’s picture

User ids can't be reassign. Once a user has been deleted, the user id he/she possessed is vanished for ever, unless as you write your own code. Letting Drupal do the dirty work is more secure, however.

Beautifulmind
Know more

Regards.
🪷 Beautifulmind

mb450’s picture

user id's are issued from the users table
the uid column is an auto_increment column.
The only way it would be reused is if you reset the auto_increment value

So your users should never be issued an historical users uid.

moofang’s picture

That is good to hear. Thanks alot guys :)