Better way to identify a user in a url

997 Views Asked by At

I have written this other question Is it secure to put the user id as a url parameter?

But I have doubts, I don't know in terms of security what is the best way to identify a user in a social network in a url so that it is bookmarkable.

For example:

The last one would be a unique nick name different from the Name and Surnames.

1

There are 1 best solutions below

0
Ramesh Lingappa On

As long as the user's unique name is constant (and not changeable) , then you can very well use that in the URL, security is not concern here unless you don't reveal sensitive informations.

But if you don't have any unique names , then you can use any hashed form of Ids in the URL , from which you can able to identify the user, like:

site.com/user/hash(id) , something like that to get short urls , if Id is random you can use that too