It is completely safe to put the uid in the URL.
If you go, for example, to your stackoverflow account, the numbers that you see in front of your name are your user ID. This is the URL of your account:
https://stackoverflow.com/users/8558489/user370486
I can see your user ID 8558489 in the url before it shows your username, but I cannot do anything malicious with this information. Websites like facebook use your username in the url, youtube uses your user id, this is what you prefer. I would rather see your username in the url because it is more meaningful when you look at it, but it is up to you! Hope this helps.
EDIT:
However, it can be argued that it may be less secure to have a username in the URL. If the application allows the username to be the same as the password, or if the username is allowed to be stored in a password, this makes an easy, gross attack. Wid is a good way to go.
Michael
source share