Bookmark Topic Watch Topic
  • New Topic

How to determine username

 
Mike Cheung
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi, is there a way to tell the login name of a visitor to a website?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Well, if the user is logged in, the username should have been captured login, no? Or if you're using the mechanism provided by the servlet container, then the HttpServletRequest.getRemoteUser() method will tell you.
 
Satya Chekuri
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Report post to moderator
Mike Cheung wrote:Hi, is there a way to tell the login name of a visitor to a website?


It all depends on how the application is implemented. If user login information is stored in session when user logs in, it can retrieved at any point till session is valid.
 
Mike Cheung
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Report post to moderator
Sorry I don't think I was being clear. I guess you both were referring to a login name used for a website? I'm actually referring to the login name the user used to login to the OS. Is there a sample implementation online I can have a look at?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
There was some discussion about that in http://www.coderanch.com/t/554235/java/java/Windows-username
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!