Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

best way to keep tracking of the user info?

 
Aymen Benhmida
Greenhorn
Posts: 12
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

i'm a newbie in jsp development and web development in general. I need to keep track of the user logged in my web application information (login, password, IP)
what is the best way to do such thing?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can store the login in the HttpSession (setAttribute). It is best to not keep track of the password. Read it once, authenticate and then keep a record in the session that the user is logged in. One way is to store the login only when authenticated. Keeping passwords in memory invites someone to do a memory dump and get them. The IP address is already available via the HttpRequest so you don't need to store it during the current session.
 
Aymen Benhmida
Greenhorn
Posts: 12
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the respons,

i have also other jsp files where i have to verify that the user is still logged before doing any action. for example, the user has created some article when logged in and then he passes to the welcome page so i have to verify that he is still logged in in order to let him some other actions. And there some other pages which must respond to the same senario. So do i have to verify that he is still logged in every page or there's a more clean way to do this.
and if this is the best way how can you advice me to do it the best possibly way.
 
Thakur Sachin Singh
Ranch Hand
Posts: 248
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can also use the html hidden field but this is not the good idea. HttpSession is best way to do that.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic