• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Curious Question relating username and password...

 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I just have a curious question that comes to my mind.

Is it possible to have two members ( or users ) having the same username but different passwords.

say,

username for user1 and user2 is "apple".

but the password for user1 is "orange" and password for user2 is "pineapple".

Is it possible??? Are they allowed to have them???

Thanks in advanced.

Philip
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Philip Zac wrote:Is it possible to have two members ( or users ) having the same username but different passwords.

What would you think ? What If your JR user name(login) is same like mine, say "philip", then whose post/account/PM the JR is supposed to show ?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49367
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure. Don't think so, no, however.
 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sagar and Campbell,

I thought there should be something to compare the username and password for a particular user. If there is same username, but different password, then it checks the comparsion of password and then assigned to that user.

Thanks

Philip
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Philip Zac wrote:If there is same username, but different password, then it checks the comparsion of password and then assigned to that user.

And what will happen, if both user sets the same password.

Philip ,
Consider, the username:password as "key:value" pair, and there shouldn't be any duplicate key.
 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sagar ... Got it..

Philip
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
 
Abhik Ghosh
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I think you have to make the username and password both unique. you can do it by comparing the new entered username and password both unique by comparing with the existing ones by using the compareToIgnoreCase function in a loop.
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhik Ghosh wrote:No, I think you have to make the username and password both unique. you can do it by comparing the new entered username and password both unique by comparing with the existing ones by using the compareToIgnoreCase function in a loop.
In most databases, the password is stored as a hashed value. No way you can compare them. If two users use the same password, their password will not appear the same in a decent database.
 
Abhik Ghosh
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks jan, you are right.. so we only make the username unique..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic